aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2010-09-21 12:35:39 +0200
committerDenys Vlasenko <dvlasenk@redhat.com>2010-09-21 12:35:39 +0200
commit0e13b4019c3d05933ba8d37357023bfcd82e8106 (patch)
treef94d25957af99bb2c6cd9c54975ce09fc12f95c3
parent63adf838143e78b0857af39a2d365fc86bcf0cd4 (diff)
downloadbusybox-w32-0e13b4019c3d05933ba8d37357023bfcd82e8106.tar.gz
busybox-w32-0e13b4019c3d05933ba8d37357023bfcd82e8106.tar.bz2
busybox-w32-0e13b4019c3d05933ba8d37357023bfcd82e8106.zip
hush: use smaller EXP_FLAG_foo constants
function old new delta expand_string_to_string 126 124 -2 parse_stream 2376 2370 -6 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-8) Total: -8 bytes Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
-rw-r--r--shell/hush.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/shell/hush.c b/shell/hush.c
index 6e36078c2..4c597e1ed 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -391,18 +391,10 @@ enum {
391 RES_SNTX 391 RES_SNTX
392}; 392};
393 393
394enum {
395 EXP_FLAG_GLOB = 0x200,
396 EXP_FLAG_ESC_GLOB_CHARS = 0x100,
397 EXP_FLAG_SINGLEWORD = 0x80, /* must be 0x80 */
398};
399
400typedef struct o_string { 394typedef struct o_string {
401 char *data; 395 char *data;
402 int length; /* position where data is appended */ 396 int length; /* position where data is appended */
403 int maxlen; 397 int maxlen;
404 /* Protect newly added chars against globbing
405 * (by prepending \ to *, ?, [, \) */
406 int o_expflags; 398 int o_expflags;
407 /* At least some part of the string was inside '' or "", 399 /* At least some part of the string was inside '' or "",
408 * possibly empty one: word"", wo''rd etc. */ 400 * possibly empty one: word"", wo''rd etc. */
@@ -411,10 +403,18 @@ typedef struct o_string {
411 smallint o_assignment; /* 0:maybe, 1:yes, 2:no */ 403 smallint o_assignment; /* 0:maybe, 1:yes, 2:no */
412} o_string; 404} o_string;
413enum { 405enum {
414 MAYBE_ASSIGNMENT = 0, 406 EXP_FLAG_SINGLEWORD = 0x80, /* must be 0x80 */
407 EXP_FLAG_GLOB = 0x2,
408 /* Protect newly added chars against globbing
409 * by prepending \ to *, ?, [, \ */
410 EXP_FLAG_ESC_GLOB_CHARS = 0x1,
411};
412enum {
413 MAYBE_ASSIGNMENT = 0,
415 DEFINITELY_ASSIGNMENT = 1, 414 DEFINITELY_ASSIGNMENT = 1,
416 NOT_ASSIGNMENT = 2, 415 NOT_ASSIGNMENT = 2,
417 WORD_IS_KEYWORD = 3, /* not assigment, but next word may be: "if v=xyz cmd;" */ 416 /* Not an assigment, but next word may be: "if v=xyz cmd;" */
417 WORD_IS_KEYWORD = 3,
418}; 418};
419/* Used for initialization: o_string foo = NULL_O_STRING; */ 419/* Used for initialization: o_string foo = NULL_O_STRING; */
420#define NULL_O_STRING { NULL } 420#define NULL_O_STRING { NULL }