hush: fix hush -c 'echo $0' - was showing empty string
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
e85248afa2
commit
5ae8f1cdbe
@ -7093,6 +7093,7 @@ int hush_main(int argc, char **argv)
|
|||||||
/* -c 'script' (no params): prevent empty $0 */
|
/* -c 'script' (no params): prevent empty $0 */
|
||||||
G.global_argv--; /* points to argv[i] of 'script' */
|
G.global_argv--; /* points to argv[i] of 'script' */
|
||||||
G.global_argv[0] = argv[0];
|
G.global_argv[0] = argv[0];
|
||||||
|
G.global_argc++;
|
||||||
} /* else -c 'script' ARG0 [ARG1...]: $0 is ARG0 */
|
} /* else -c 'script' ARG0 [ARG1...]: $0 is ARG0 */
|
||||||
init_sigmasks();
|
init_sigmasks();
|
||||||
parse_and_run_string(optarg);
|
parse_and_run_string(optarg);
|
||||||
|
Loading…
Reference in New Issue
Block a user