about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-09-23 14:30:25 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-09-23 14:30:25 +0000
commite504499d98a057b0e39bb019707cb905bdbe7e62 (patch)
treed97710ec20ee5c19b62fadfd400c0f8ec388935d
parentc212ee5b06065492316b4ae9e600165f241087d1 (diff)
downloadzsh-e504499d98a057b0e39bb019707cb905bdbe7e62.tar.gz
zsh-e504499d98a057b0e39bb019707cb905bdbe7e62.tar.xz
zsh-e504499d98a057b0e39bb019707cb905bdbe7e62.zip
zsh-workers/8033
-rw-r--r--Doc/Zsh/arith.yo5
-rw-r--r--Src/math.c2
2 files changed, 4 insertions, 3 deletions
diff --git a/Doc/Zsh/arith.yo b/Doc/Zsh/arith.yo
index b18aed94c..29897a233 100644
--- a/Doc/Zsh/arith.yo
+++ b/Doc/Zsh/arith.yo
@@ -86,13 +86,14 @@ if the var(args) is used as a string or a comma-separated list of
 arithmetic expressions. The shell currently defines no mathematical
 functions, but modules may define some.
 
-An expression of the form `tt(#\)var(x)' where var(x) is any character
+An expression of the form `tt(##)var(x)' where var(x) is any character
 sequence such as `tt(a)', `tt(^A)', or `tt(\M-\C-x)' gives the ascii
 value of this character and an expression of the form `tt(#)var(foo)'
 gives the ascii value of the first character of the value of the
 parameter var(foo).  Note that this is different from the expression
 `tt($#)var(foo)', a standard parameter substitution which gives the
-length of the parameter var(foo).
+length of the parameter var(foo).  `tt(#\)' is accepted instead of
+`tt(##)', but its use is deprecated.
 
 Named parameters and subscripted arrays can be referenced by name within an
 arithmetic expression without using the parameter expansion syntax.  For
diff --git a/Src/math.c b/Src/math.c
index e764e5957..d9855f1ba 100644
--- a/Src/math.c
+++ b/Src/math.c
@@ -374,7 +374,7 @@ zzlex(void)
 		return NUM;
 	    }
 	    if (*ptr == '#') {
-		if (*++ptr == '\\') {
+		if (*++ptr == '\\' || *ptr == '#') {
 		    int v;
 
 		    ptr++;