about summary refs log tree commit diff
path: root/Src/zsh.h
diff options
context:
space:
mode:
authorPaul Ackersviller <packersv@users.sourceforge.net>2007-06-25 03:11:44 +0000
committerPaul Ackersviller <packersv@users.sourceforge.net>2007-06-25 03:11:44 +0000
commitf2f3b86a5f15500dfee707d27eee9784a1626e4d (patch)
treed58c84a358497843dbdf54088e4e441bbf9447e1 /Src/zsh.h
parent3fb7cb46276374c248d24802e04d0947743d2d8d (diff)
downloadzsh-f2f3b86a5f15500dfee707d27eee9784a1626e4d.tar.gz
zsh-f2f3b86a5f15500dfee707d27eee9784a1626e4d.tar.xz
zsh-f2f3b86a5f15500dfee707d27eee9784a1626e4d.zip
Merge of 21862/21863/21870: GLOB_SUBST shouldn't swallow up backslashes in
parameter substitutions that don't match anything.
Diffstat (limited to 'Src/zsh.h')
-rw-r--r--Src/zsh.h29
1 files changed, 25 insertions, 4 deletions
diff --git a/Src/zsh.h b/Src/zsh.h
index 4500cb21e..a0959456a 100644
--- a/Src/zsh.h
+++ b/Src/zsh.h
@@ -128,7 +128,10 @@ struct mathfunc {
 
 #define DEFAULT_IFS	" \t\n\203 "
 
-/* Character tokens */
+/*
+ * Character tokens.
+ * These should match the characters in ztokens, defined in lex.c
+ */
 #define Pound		((char) 0x84)
 #define String		((char) 0x85)
 #define Hat		((char) 0x86)
@@ -149,15 +152,33 @@ struct mathfunc {
 #define Tilde		((char) 0x95)
 #define Qtick		((char) 0x96)
 #define Comma		((char) 0x97)
+/*
+ * Null arguments: placeholders for single and double quotes
+ * and backslashes.
+ */
 #define Snull		((char) 0x98)
 #define Dnull		((char) 0x99)
 #define Bnull		((char) 0x9a)
-#define Nularg		((char) 0x9b)
+/*
+ * Backslash which will be returned to "\" instead of being stripped
+ * when we turn the string into a printable format.
+ */
+#define Bnullkeep       ((char) 0x9b)
+/*
+ * Null argument that does not correspond to any character.
+ * This should be last as it does not appear in ztokens and
+ * is used to initialise the IMETA type in inittyptab().
+ */
+#define Nularg		((char) 0x9c)
 
-#define INULL(x)	(((x) & 0xfc) == 0x98)
+#define INULL(x)	((x) >= Snull && (x) <= Nularg)
 
+/*
+ * Take care to update the use of IMETA appropriately when adding
+ * tokens here.
+ */
 /* Marker used in paramsubst for rc_expand_param */
-#define Marker		((char) 0x9c)
+#define Marker		((char) 0xa0)
 
 /* chars that need to be quoted if meant literally */