summaryrefslogtreecommitdiff
path: root/system/pdksh/patches/110_Debian-exit-negative-number.patch
diff options
context:
space:
mode:
authorDaniel LEVAI <leva@ecentrum.hu>2010-05-13 01:01:03 +0200
committerMichiel van Wessem <michiel@slackbuilds.org>2010-05-13 01:01:03 +0200
commit6ec76a9860188c0e2de54daf61f5a4ff590ad8ef (patch)
treeedd70b526118253bc6ab17c0dcd069325fa5016f /system/pdksh/patches/110_Debian-exit-negative-number.patch
parent387f1e8f9c14fc5648eee03d43787806c806fe20 (diff)
downloadslackbuilds-6ec76a9860188c0e2de54daf61f5a4ff590ad8ef.tar.gz
system/pdksh: Added to 13.0 repository
Diffstat (limited to 'system/pdksh/patches/110_Debian-exit-negative-number.patch')
-rw-r--r--system/pdksh/patches/110_Debian-exit-negative-number.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/system/pdksh/patches/110_Debian-exit-negative-number.patch b/system/pdksh/patches/110_Debian-exit-negative-number.patch
new file mode 100644
index 0000000000..d7af113275
--- /dev/null
+++ b/system/pdksh/patches/110_Debian-exit-negative-number.patch
@@ -0,0 +1,46 @@
+Fix problem with `exit -1' giving `ksh: exit: -1: unknown option' (see bug#502934)
+
+Index: pdksh-5.2.14/c_sh.c
+===================================================================
+--- pdksh-5.2.14.orig/c_sh.c 2009-09-19 11:38:39.000000000 +0200
++++ pdksh-5.2.14/c_sh.c 2009-09-19 11:39:33.000000000 +0200
+@@ -534,9 +534,14 @@
+ int n;
+ char *arg;
+
+- if (ksh_getopt(wp, &builtin_opt, null) == '?')
+- return 1;
+- arg = wp[builtin_opt.optind];
++ if (!Flag(FPOSIX) // not posix
++ && *wp && *(wp + 1) && !*(wp + 2)) // only one argument passed
++ arg=*(wp + 1); // code regardless of starting with '-' or not
++ else {
++ if (ksh_getopt(wp, &builtin_opt, null) == '?')
++ return 1;
++ arg = wp[builtin_opt.optind];
++ }
+
+ if (arg) {
+ if (!getn(arg, &n)) {
+Index: pdksh-5.2.14/tests/debian-110.t
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ pdksh-5.2.14/tests/debian-110.t 2009-09-19 11:41:59.000000000 +0200
+@@ -0,0 +1,17 @@
++name: debian-110-1
++description:
++ Check if exit -1 is allowed for ! posix
++stdin:
++ (set +o posix; exit -1); echo A $?
++expected-stdout:
++ A 255
++---
++name: debian-110-2
++description:
++ Check if exit -1 is not allowed for posix
++stdin:
++ (set -o posix; exit -1); echo A $?
++expected-stdout:
++ A 1
++expected-fail: yes
++---