git.annexia.org
/
libguestfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
todo docs: Discuss shrinking filesystems and specifying sizes in guestfish.
[libguestfs.git]
/
fish
/
fish.c
diff --git
a/fish/fish.c
b/fish/fish.c
index
bd13a82
..
61a8405
100644
(file)
--- a/
fish/fish.c
+++ b/
fish/fish.c
@@
-768,6
+768,15
@@
cmdline (char *argv[], int optind, int argc)
fprintf (stderr, _("%s: empty command on command line\n"), program_name);
exit (EXIT_FAILURE);
}
fprintf (stderr, _("%s: empty command on command line\n"), program_name);
exit (EXIT_FAILURE);
}
+
+ /* Allow -cmd on the command line to mean (temporarily) override
+ * the normal exit on error (RHBZ#578407).
+ */
+ if (cmd[0] == '-') {
+ exit_on_error = 0;
+ cmd++;
+ }
+
params = &argv[optind];
/* Search for end of command list or ":" ... */
params = &argv[optind];
/* Search for end of command list or ":" ... */
@@
-775,10
+784,12
@@
cmdline (char *argv[], int optind, int argc)
optind++;
if (optind == argc) {
optind++;
if (optind == argc) {
- if (issue_command (cmd, params, NULL) == -1) exit (EXIT_FAILURE);
+ if (issue_command (cmd, params, NULL) == -1 && exit_on_error)
+ exit (EXIT_FAILURE);
} else {
argv[optind] = NULL;
} else {
argv[optind] = NULL;
- if (issue_command (cmd, params, NULL) == -1) exit (EXIT_FAILURE);
+ if (issue_command (cmd, params, NULL) == -1 && exit_on_error)
+ exit (EXIT_FAILURE);
cmdline (argv, optind+1, argc);
}
}
cmdline (argv, optind+1, argc);
}
}