summaryrefslogtreecommitdiff
path: root/system/pdksh/patches/104_Debian-#415167-lack-of-dot-arguments.patch
blob: ee3eca2ff008113f826827a773d60b8dec5154cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
unset on unknown variable is not an error, 
see http://www.opengroup.org/onlinepubs/009695399/utilities/unset.html
(from PLD)

@DPATCH@
Index: pdksh-5.2.14/c_sh.c
===================================================================
--- pdksh-5.2.14.orig/c_sh.c	2008-04-15 20:56:22.000000000 +0200
+++ pdksh-5.2.14/c_sh.c	2008-04-15 20:56:53.000000000 +0200
@@ -183,8 +183,10 @@
 	if (ksh_getopt(wp, &builtin_opt, null) == '?')
 		return 1;
 
-	if ((cp = wp[builtin_opt.optind]) == NULL)
-		return 0;
+	if ((cp = wp[builtin_opt.optind]) == NULL) {
+		bi_errorf("missing argument");
+		return 1;
+	}		
 	file = search(cp, path, R_OK, &err);
 	if (file == NULL) {
 		bi_errorf("%s: %s", cp, err ? strerror(err) : "not found");