← Commit list

992e0ff7e

Denys Vlasenko
Denys Vlasenko
2016-09-29
SUCCESS Duration: 186s

Subject

hush: fix ". EMPTY_LINE" not setting $? to 0

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

shell/ash_test/ash-misc/source3.right+2 -0
@@ -0,0 +1,2 @@
+Zero:0
+Zero:0
shell/ash_test/ash-misc/source3.tests+6 -0
@@ -0,0 +1,6 @@
+# Test both empty file, and one-empty-line file
+echo >sourced1
+true >sourced2
+false; . ./sourced1; echo Zero:$?
+false; . ./sourced2; echo Zero:$?
+rm sourced1 sourced2
shell/hush.c+2 -0
@@ -9156,6 +9156,8 @@ static int FAST_FUNC builtin_source(char **argv)
if (argv[1])
save_and_replace_G_args(&sv, argv);
+ /* "false; . ./empty_line; echo Zero:$?" should print 0 */
+ G.last_exitcode = 0;
parse_and_run_file(input);
fclose_and_forget(input);
shell/hush_test/hush-misc/source3.right+2 -0
@@ -0,0 +1,2 @@
+Zero:0
+Zero:0
shell/hush_test/hush-misc/source3.tests+6 -0
@@ -0,0 +1,6 @@
+# Test both empty file, and one-empty-line file
+echo >sourced1
+true >sourced2
+false; . ./sourced1; echo Zero:$?
+false; . ./sourced2; echo Zero:$?
+rm sourced1 sourced2