summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2016-10-08 08:24:38 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2016-10-08 08:24:38 +0000
commitcfff612229d7a4ed4990223e64e45376f94aefd5 (patch)
tree94572f8ee3e4c73070c89e859323722de0beb547 /src
parent9e944ca500a6aadbac604cb0f32e5c7988de6c20 (diff)
downloadexecline-cfff612229d7a4ed4990223e64e45376f94aefd5.tar.xz
bugfix: tryexec -n segfaulted with empty remainder (thanks muhmuhten)
Diffstat (limited to 'src')
-rw-r--r--src/execline/tryexec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/execline/tryexec.c b/src/execline/tryexec.c
index 46d3479..0612210 100644
--- a/src/execline/tryexec.c
+++ b/src/execline/tryexec.c
@@ -39,6 +39,8 @@ int main (int argc, char const **argv, char const *const *envp)
int argc1 = el_semicolon(argv) ;
if (!argc1) strerr_dief1x(100, "empty block") ;
if (argc1 >= argc) strerr_dief1x(100, "unterminated block") ;
+ if (not && argc1 == argc - 1)
+ strerr_dief1x(100, "empty remainder not allowed with -n") ;
argv[argc1] = 0 ;
dom = argv + not * (argc1 + 1) ;
sub = argv + !not * (argc1 + 1) ;