summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2009-07-02 13:46:36 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2009-07-02 13:46:36 +0000
commit5c5a388ed7ec05d32c73991bc2fa385bf1090ab8 (patch)
treed959af7afb2d343dc6444bfdc5bcbe2dcc7bb742
parent7a1f580c036741585368086163ec24607c72c3a8 (diff)
downloadzsh-5c5a388ed7ec05d32c73991bc2fa385bf1090ab8.tar.gz
zsh-5c5a388ed7ec05d32c73991bc2fa385bf1090ab8.tar.xz
zsh-5c5a388ed7ec05d32c73991bc2fa385bf1090ab8.zip
27087: change return codes from failed "."
-rw-r--r--ChangeLog6
-rw-r--r--Doc/Zsh/builtins.yo4
-rw-r--r--Src/builtin.c2
-rw-r--r--Src/zsh.h6
-rw-r--r--Test/A01grammar.ztst4
5 files changed, 13 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 565ba3543..5d5436503 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2009-07-02  Peter Stephenson  <pws@csr.com>
 
+	* 27087: Doc/Zsh/builtins.yo, Src/builtin.c, Src/zsh.h,
+	Test/A01grammar.ztst:  change return codes from 27083 to
+	126, 127.
+
 	* Nicolas Pouillard: 27028: Completion/Unix/Command/_darcs: New
 	darcs completion; it's a lot shorter but apparently that's OK.
 
@@ -11895,5 +11899,5 @@
 
 *****************************************************
 * This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.4725 $
+* $Revision: 1.4726 $
 *****************************************************
diff --git a/Doc/Zsh/builtins.yo b/Doc/Zsh/builtins.yo
index 3047b3371..bf12a3384 100644
--- a/Doc/Zsh/builtins.yo
+++ b/Doc/Zsh/builtins.yo
@@ -46,8 +46,8 @@ then commands are read from that file instead of var(file).
 If any arguments var(arg) are given,
 they become the positional parameters; the old positional
 parameters are restored when the var(file) is done executing.
-If var(file) was not found the return status is 129; if var(file) was found
-but contained a syntax error the return status is 128; else the return
+If var(file) was not found the return status is 127; if var(file) was found
+but contained a syntax error the return status is 126; else the return
 status is the exit status of the last command executed.
 )
 findex(NOTRANS(:))
diff --git a/Src/builtin.c b/Src/builtin.c
index 1f41b1e87..62c6e3c7d 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -4773,7 +4773,7 @@ bin_dot(char *name, char **argv, UNUSED(Options ops), UNUSED(int func))
     zsfree(arg0);
     if (old0)
 	argzero = old0;
-    return ret == SOURCE_OK ? lastval : 127 + ret;
+    return ret == SOURCE_OK ? lastval : 128 - ret;
 }
 
 /*
diff --git a/Src/zsh.h b/Src/zsh.h
index 87b561085..bd872a55a 100644
--- a/Src/zsh.h
+++ b/Src/zsh.h
@@ -1730,10 +1730,10 @@ struct nameddir {
 enum source_return {
     /* Source ran OK */
     SOURCE_OK = 0,
-    /* Internal error sourcing file */
-    SOURCE_ERROR = 1,
     /* File not found */
-    SOURCE_NOT_FOUND = 2
+    SOURCE_NOT_FOUND = 1,
+    /* Internal error sourcing file */
+    SOURCE_ERROR = 2
 };
 
 /***********************************/
diff --git a/Test/A01grammar.ztst b/Test/A01grammar.ztst
index 3d0337a1c..8f4ed2c19 100644
--- a/Test/A01grammar.ztst
+++ b/Test/A01grammar.ztst
@@ -515,10 +515,10 @@
 >not#comment
 
   . ./nonexistent
-129: Attempt to "." non-existent file.
+127: Attempt to "." non-existent file.
 ?(eval):.:1: no such file or directory: ./nonexistent
 
   echo '[[' >bad_syntax
   . ./bad_syntax
-128: Attempt to "." file with bad syntax.
+126: Attempt to "." file with bad syntax.
 ?./bad_syntax:2: parse error near `\n'