diff options
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ash.c | 12 | ||||
-rwxr-xr-x | shell/ash_test/ash-misc/unicode1.tests | 2 | ||||
-rw-r--r-- | shell/hush.c | 12 | ||||
-rwxr-xr-x | shell/hush_test/hush-misc/unicode1.tests | 2 |
4 files changed, 14 insertions, 14 deletions
diff --git a/shell/ash.c b/shell/ash.c index e170bec2a..70ee15ed8 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -3849,7 +3849,7 @@ setjobctl(int on) | |||
3849 | } | 3849 | } |
3850 | /* fd is a tty at this point */ | 3850 | /* fd is a tty at this point */ |
3851 | fd = fcntl(fd, F_DUPFD, 10); | 3851 | fd = fcntl(fd, F_DUPFD, 10); |
3852 | if (ofd >= 0) /* if it is "/dev/tty", close. If 0/1/2, dont */ | 3852 | if (ofd >= 0) /* if it is "/dev/tty", close. If 0/1/2, don't */ |
3853 | close(ofd); | 3853 | close(ofd); |
3854 | if (fd < 0) | 3854 | if (fd < 0) |
3855 | goto out; /* F_DUPFD failed */ | 3855 | goto out; /* F_DUPFD failed */ |
@@ -6310,7 +6310,7 @@ static char *evalvar(char *p, int flags, struct strlist *var_str_list); | |||
6310 | * $@ like $* since no splitting will be performed. | 6310 | * $@ like $* since no splitting will be performed. |
6311 | * | 6311 | * |
6312 | * var_str_list (can be NULL) is a list of "VAR=val" strings which take precedence | 6312 | * var_str_list (can be NULL) is a list of "VAR=val" strings which take precedence |
6313 | * over shell varables. Needed for "A=a B=$A; echo $B" case - we use it | 6313 | * over shell variables. Needed for "A=a B=$A; echo $B" case - we use it |
6314 | * for correct expansion of "B=$A" word. | 6314 | * for correct expansion of "B=$A" word. |
6315 | */ | 6315 | */ |
6316 | static void | 6316 | static void |
@@ -6520,8 +6520,8 @@ scanright(char *startp, char *rmesc, char *rmescend, | |||
6520 | if (try2optimize) { | 6520 | if (try2optimize) { |
6521 | /* Maybe we can optimize this: | 6521 | /* Maybe we can optimize this: |
6522 | * if pattern ends with unescaped *, we can avoid checking | 6522 | * if pattern ends with unescaped *, we can avoid checking |
6523 | * shorter strings: if "foo*" doesnt match "raw_value_of_v", | 6523 | * shorter strings: if "foo*" doesn't match "raw_value_of_v", |
6524 | * it wont match truncated "raw_value_of_" strings too. | 6524 | * it won't match truncated "raw_value_of_" strings too. |
6525 | */ | 6525 | */ |
6526 | unsigned plen = strlen(pattern); | 6526 | unsigned plen = strlen(pattern); |
6527 | /* Does it end with "*"? */ | 6527 | /* Does it end with "*"? */ |
@@ -7248,7 +7248,7 @@ expandmeta(struct strlist *str /*, int flag*/) | |||
7248 | // Which means you need to unescape the string, right? Not so fast: | 7248 | // Which means you need to unescape the string, right? Not so fast: |
7249 | // if there _is_ a file named "file\?" (with backslash), it is returned | 7249 | // if there _is_ a file named "file\?" (with backslash), it is returned |
7250 | // as "file\?" too (whichever pattern you used to find it, say, "file*"). | 7250 | // as "file\?" too (whichever pattern you used to find it, say, "file*"). |
7251 | // You DONT KNOW by looking at the result whether you need to unescape it. | 7251 | // You DON'T KNOW by looking at the result whether you need to unescape it. |
7252 | // | 7252 | // |
7253 | // Worse, globbing of "file\?" in a directory with two files, "file?" and "file\?", | 7253 | // Worse, globbing of "file\?" in a directory with two files, "file?" and "file\?", |
7254 | // returns "file\?" - which is WRONG: "file\?" pattern matches "file?" file. | 7254 | // returns "file\?" - which is WRONG: "file\?" pattern matches "file?" file. |
@@ -13088,7 +13088,7 @@ exportcmd(int argc UNUSED_PARAM, char **argv) | |||
13088 | } | 13088 | } |
13089 | flag_off = ~flag_off; | 13089 | flag_off = ~flag_off; |
13090 | 13090 | ||
13091 | /*if (opt_p_not_specified) - bash doesnt check this. Try "export -p NAME" */ | 13091 | /*if (opt_p_not_specified) - bash doesn't check this. Try "export -p NAME" */ |
13092 | { | 13092 | { |
13093 | aptr = argptr; | 13093 | aptr = argptr; |
13094 | name = *aptr; | 13094 | name = *aptr; |
diff --git a/shell/ash_test/ash-misc/unicode1.tests b/shell/ash_test/ash-misc/unicode1.tests index 8788ba910..b8479cb41 100755 --- a/shell/ash_test/ash-misc/unicode1.tests +++ b/shell/ash_test/ash-misc/unicode1.tests | |||
@@ -5,7 +5,7 @@ a=`printf "\xcc\x80"` | |||
5 | # Should print 1 | 5 | # Should print 1 |
6 | echo ${#a} | 6 | echo ${#a} |
7 | 7 | ||
8 | # A Japanese katakana charachter U+30a3 | 8 | # A Japanese katakana character U+30a3 |
9 | a=`printf "\xe3\x82\xa3"` | 9 | a=`printf "\xe3\x82\xa3"` |
10 | # Should print 1 | 10 | # Should print 1 |
11 | echo ${#a} | 11 | echo ${#a} |
diff --git a/shell/hush.c b/shell/hush.c index 4123cc19e..e18920f50 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -1908,7 +1908,7 @@ static int check_and_run_traps(void) | |||
1908 | G.count_SIGCHLD++; | 1908 | G.count_SIGCHLD++; |
1909 | //bb_error_msg("[%d] check_and_run_traps: G.count_SIGCHLD:%d G.handled_SIGCHLD:%d", getpid(), G.count_SIGCHLD, G.handled_SIGCHLD); | 1909 | //bb_error_msg("[%d] check_and_run_traps: G.count_SIGCHLD:%d G.handled_SIGCHLD:%d", getpid(), G.count_SIGCHLD, G.handled_SIGCHLD); |
1910 | /* Note: | 1910 | /* Note: |
1911 | * We dont do 'last_sig = sig' here -> NOT returning this sig. | 1911 | * We don't do 'last_sig = sig' here -> NOT returning this sig. |
1912 | * This simplifies wait builtin a bit. | 1912 | * This simplifies wait builtin a bit. |
1913 | */ | 1913 | */ |
1914 | break; | 1914 | break; |
@@ -1917,7 +1917,7 @@ static int check_and_run_traps(void) | |||
1917 | debug_printf_exec("%s: sig:%d default handling is to ignore\n", __func__, sig); | 1917 | debug_printf_exec("%s: sig:%d default handling is to ignore\n", __func__, sig); |
1918 | /* SIGTERM, SIGQUIT, SIGTTIN, SIGTTOU, SIGTSTP */ | 1918 | /* SIGTERM, SIGQUIT, SIGTTIN, SIGTTOU, SIGTSTP */ |
1919 | /* Note: | 1919 | /* Note: |
1920 | * We dont do 'last_sig = sig' here -> NOT returning this sig. | 1920 | * We don't do 'last_sig = sig' here -> NOT returning this sig. |
1921 | * Example: wait is not interrupted by TERM | 1921 | * Example: wait is not interrupted by TERM |
1922 | * in interactive shell, because TERM is ignored. | 1922 | * in interactive shell, because TERM is ignored. |
1923 | */ | 1923 | */ |
@@ -2280,7 +2280,7 @@ static void reinit_unicode_for_hush(void) | |||
2280 | * AT\ | 2280 | * AT\ |
2281 | * H\ | 2281 | * H\ |
2282 | * \ | 2282 | * \ |
2283 | * It excercises a lot of corner cases. | 2283 | * It exercises a lot of corner cases. |
2284 | */ | 2284 | */ |
2285 | static void cmdedit_update_prompt(void) | 2285 | static void cmdedit_update_prompt(void) |
2286 | { | 2286 | { |
@@ -5235,7 +5235,7 @@ static void o_addblock_duplicate_backslash(o_string *o, const char *str, int len | |||
5235 | /* And now we want to add { or } and continue: | 5235 | /* And now we want to add { or } and continue: |
5236 | * o_addchr(o, c); | 5236 | * o_addchr(o, c); |
5237 | * continue; | 5237 | * continue; |
5238 | * luckily, just falling throught achieves this. | 5238 | * luckily, just falling through achieves this. |
5239 | */ | 5239 | */ |
5240 | } | 5240 | } |
5241 | #endif | 5241 | #endif |
@@ -5830,7 +5830,7 @@ static NOINLINE int expand_vars_to_list(o_string *output, int n, char *arg) | |||
5830 | arg++; | 5830 | arg++; |
5831 | /* Can't just stuff it into output o_string, | 5831 | /* Can't just stuff it into output o_string, |
5832 | * expanded result may need to be globbed | 5832 | * expanded result may need to be globbed |
5833 | * and $IFS-splitted */ | 5833 | * and $IFS-split */ |
5834 | debug_printf_subst("SUBST '%s' first_ch %x\n", arg, first_ch); | 5834 | debug_printf_subst("SUBST '%s' first_ch %x\n", arg, first_ch); |
5835 | G.last_exitcode = process_command_subs(&subst_result, arg); | 5835 | G.last_exitcode = process_command_subs(&subst_result, arg); |
5836 | debug_printf_subst("SUBST RES:%d '%s'\n", G.last_exitcode, subst_result.data); | 5836 | debug_printf_subst("SUBST RES:%d '%s'\n", G.last_exitcode, subst_result.data); |
@@ -7320,7 +7320,7 @@ static int process_wait_result(struct pipe *fg_pipe, pid_t childpid, int status) | |||
7320 | /* There are still running processes in the fg_pipe */ | 7320 | /* There are still running processes in the fg_pipe */ |
7321 | return -1; | 7321 | return -1; |
7322 | } | 7322 | } |
7323 | /* It wasnt in fg_pipe, look for process in bg pipes */ | 7323 | /* It wasn't in fg_pipe, look for process in bg pipes */ |
7324 | } | 7324 | } |
7325 | 7325 | ||
7326 | #if ENABLE_HUSH_JOB | 7326 | #if ENABLE_HUSH_JOB |
diff --git a/shell/hush_test/hush-misc/unicode1.tests b/shell/hush_test/hush-misc/unicode1.tests index 8788ba910..b8479cb41 100755 --- a/shell/hush_test/hush-misc/unicode1.tests +++ b/shell/hush_test/hush-misc/unicode1.tests | |||
@@ -5,7 +5,7 @@ a=`printf "\xcc\x80"` | |||
5 | # Should print 1 | 5 | # Should print 1 |
6 | echo ${#a} | 6 | echo ${#a} |
7 | 7 | ||
8 | # A Japanese katakana charachter U+30a3 | 8 | # A Japanese katakana character U+30a3 |
9 | a=`printf "\xe3\x82\xa3"` | 9 | a=`printf "\xe3\x82\xa3"` |
10 | # Should print 1 | 10 | # Should print 1 |
11 | echo ${#a} | 11 | echo ${#a} |