summaryrefslogtreecommitdiffstats
path: root/src/bbe.c
diff options
context:
space:
mode:
authorTimo Savinen <tjsa@iki.fi>2005-09-27 14:29:01 +0000
committerHadrien Dorio <hadrien.dorio@gmail.com>2017-12-16 00:24:05 +0100
commit11460c1f56ed4939c8f0df0482059f5fecd289fa (patch)
tree4734a3d9bd595f2e0b9c4a2d57ba04a3c1b8c287 /src/bbe.c
parentb9eb6e4429575318d3c510b99961093c42321529 (diff)
downloadbinary-block-editor-11460c1f56ed4939c8f0df0482059f5fecd289fa.tar.gz
binary-block-editor-11460c1f56ed4939c8f0df0482059f5fecd289fa.zip
0.1.2
Diffstat (limited to 'src/bbe.c')
-rw-r--r--src/bbe.c44
1 files changed, 40 insertions, 4 deletions
diff --git a/src/bbe.c b/src/bbe.c
index 9743ac2..6a57fab 100644
--- a/src/bbe.c
+++ b/src/bbe.c
@@ -20,7 +20,7 @@
*
*/
-/* $Id: bbe.c,v 1.30 2005/09/25 10:03:47 timo Exp $ */
+/* $Id: bbe.c,v 1.33 2005/09/30 10:58:15 timo Exp $ */
#include "bbe.h"
#ifdef HAVE_GETOPT_H
@@ -43,7 +43,7 @@ static char *program = "bbe";
#ifdef VERSION
static char *version = VERSION;
#else
-static char *version = "0.1.1";
+static char *version = "0.1.2";
#endif
#ifdef PACKAGE_BUGREPORT
@@ -176,9 +176,35 @@ parse_string(char *string,off_t *length)
if(*p == '\\')
{
p++;
- if(*p == '\\' || *p == ';')
+ if(strchr("\\;abtnvfr",*p) != NULL)
{
- buf[i] = *p++;
+ switch(*p)
+ {
+ case 'a':
+ buf[i] = '\a';
+ break;
+ case 'b':
+ buf[i] = '\b';
+ break;
+ case 't':
+ buf[i] = '\t';
+ break;
+ case 'n':
+ buf[i] = '\n';
+ break;
+ case 'v':
+ buf[i] = '\v';
+ break;
+ case 'f':
+ buf[i] = '\f';
+ break;
+ case 'r':
+ buf[i] = '\r';
+ break;
+ default:
+ buf[i] = *p;
+ }
+ p++;
} else
{
j = 0;
@@ -509,6 +535,16 @@ parse_command(char *command_string)
case 'N':
if(i != 1 || strlen(token[0]) > 1) panic("Error in command",command_string,NULL);
break;
+ case '&':
+ case '|':
+ case '^':
+ if(i != 2 || strlen(token[0]) > 1) panic("Error in command",command_string,NULL);
+ new->s1 = parse_string(token[1],&new->s1_len);
+ if(new->s1_len != 1) panic("Error in command",command_string,NULL);
+ break;
+ case '~':
+ if(i != 1 || strlen(token[0]) > 1) panic("Error in command",command_string,NULL);
+ break;
default:
panic("Unknown command",command_string,NULL);
break;
OpenPOWER on IntegriCloud