diff options
| author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-09-21 22:35:18 +0000 |
|---|---|---|
| committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-09-21 22:35:18 +0000 |
| commit | f43101753558a772b8317409cf542b3e3631cd13 (patch) | |
| tree | 365763acc3ee1b21fcc13656fce6f069a7623e61 /shell | |
| parent | bcceb0c5a4a6b69225ae9b748df96e013996d9d3 (diff) | |
| download | busybox-w32-f43101753558a772b8317409cf542b3e3631cd13.tar.gz busybox-w32-f43101753558a772b8317409cf542b3e3631cd13.tar.bz2 busybox-w32-f43101753558a772b8317409cf542b3e3631cd13.zip | |
httpd: optional support for partial downloads
Diffstat (limited to 'shell')
| -rw-r--r-- | shell/ash.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/shell/ash.c b/shell/ash.c index 167232c33..492474110 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
| @@ -2494,6 +2494,7 @@ pwdcmd(int argc, char **argv) | |||
| 2494 | #define DQSYNTAX 1 /* in double quotes */ | 2494 | #define DQSYNTAX 1 /* in double quotes */ |
| 2495 | #define SQSYNTAX 2 /* in single quotes */ | 2495 | #define SQSYNTAX 2 /* in single quotes */ |
| 2496 | #define ARISYNTAX 3 /* in arithmetic */ | 2496 | #define ARISYNTAX 3 /* in arithmetic */ |
| 2497 | #define PSSYNTAX 4 /* prompt */ | ||
| 2497 | 2498 | ||
| 2498 | #if ENABLE_ASH_OPTIMIZE_FOR_SIZE | 2499 | #if ENABLE_ASH_OPTIMIZE_FOR_SIZE |
| 2499 | #define USE_SIT_FUNCTION | 2500 | #define USE_SIT_FUNCTION |
| @@ -9886,6 +9887,9 @@ readtoken1(int firstc, int syntax, char *eofmark, int striptabs) | |||
| 9886 | smallint dblquote; | 9887 | smallint dblquote; |
| 9887 | smallint oldstyle; | 9888 | smallint oldstyle; |
| 9888 | smallint prevsyntax; /* syntax before arithmetic */ | 9889 | smallint prevsyntax; /* syntax before arithmetic */ |
| 9890 | #if ENABLE_ASH_EXPAND_PRMT | ||
| 9891 | smallint pssyntax; /* we are expanding a prompt string */ | ||
| 9892 | #endif | ||
| 9889 | int varnest; /* levels of variables expansion */ | 9893 | int varnest; /* levels of variables expansion */ |
| 9890 | int arinest; /* levels of arithmetic expansion */ | 9894 | int arinest; /* levels of arithmetic expansion */ |
| 9891 | int parenlevel; /* levels of parens in arithmetic */ | 9895 | int parenlevel; /* levels of parens in arithmetic */ |
| @@ -9910,6 +9914,11 @@ readtoken1(int firstc, int syntax, char *eofmark, int striptabs) | |||
| 9910 | dblquote = (syntax == DQSYNTAX); | 9914 | dblquote = (syntax == DQSYNTAX); |
| 9911 | oldstyle = 0; | 9915 | oldstyle = 0; |
| 9912 | prevsyntax = 0; | 9916 | prevsyntax = 0; |
| 9917 | #if ENABLE_ASH_EXPAND_PRMT | ||
| 9918 | pssyntax = (syntax == PSSYNTAX); | ||
| 9919 | if (pssyntax) | ||
| 9920 | syntax = DQSYNTAX; | ||
| 9921 | #endif | ||
| 9913 | varnest = 0; | 9922 | varnest = 0; |
| 9914 | arinest = 0; | 9923 | arinest = 0; |
| 9915 | parenlevel = 0; | 9924 | parenlevel = 0; |
| @@ -9948,6 +9957,12 @@ readtoken1(int firstc, int syntax, char *eofmark, int striptabs) | |||
| 9948 | if (doprompt) | 9957 | if (doprompt) |
| 9949 | setprompt(2); | 9958 | setprompt(2); |
| 9950 | } else { | 9959 | } else { |
| 9960 | #if ENABLE_ASH_EXPAND_PRMT | ||
| 9961 | if (c == '$' && pssyntax) { | ||
| 9962 | USTPUTC(CTLESC, out); | ||
| 9963 | USTPUTC('\\', out); | ||
| 9964 | } | ||
| 9965 | #endif | ||
| 9951 | if (dblquote && | 9966 | if (dblquote && |
| 9952 | c != '\\' && c != '`' && | 9967 | c != '\\' && c != '`' && |
| 9953 | c != '$' && ( | 9968 | c != '$' && ( |
| @@ -10780,7 +10795,7 @@ expandstr(const char *ps) | |||
| 10780 | 10795 | ||
| 10781 | /* XXX Fix (char *) cast. */ | 10796 | /* XXX Fix (char *) cast. */ |
| 10782 | setinputstring((char *)ps); | 10797 | setinputstring((char *)ps); |
| 10783 | readtoken1(pgetc(), DQSYNTAX, nullstr, 0); | 10798 | readtoken1(pgetc(), PSSYNTAX, nullstr, 0); |
| 10784 | popfile(); | 10799 | popfile(); |
| 10785 | 10800 | ||
| 10786 | n.narg.type = NARG; | 10801 | n.narg.type = NARG; |
