Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH] cond: use untokenised name when tracing module condition



  % zmodload zsh/example &> /dev/null
  % function -T { [[ -len foo 3 ]] }
  +(anon):0> [[ ?len foo 3 ]]

we've already untokenised it for zwarnnam (not sure why, it does that
for you), so we can re-use that

dana


diff --git a/Src/cond.c b/Src/cond.c
index 9f13e07d7..df3c901ae 100644
--- a/Src/cond.c
+++ b/Src/cond.c
@@ -154,7 +154,7 @@ evalcond(Estate state, char *fromtest)
 		    return 2;
 		}
 		if (tracingcond)
-		    tracemodcond(name, strs, ctype == COND_MODI);
+		    tracemodcond(errname, strs, ctype == COND_MODI);
 		return !cd->handler(strs, cd->condid);
 	    }
 	    else {
@@ -181,7 +181,7 @@ evalcond(Estate state, char *fromtest)
 			return 2;
 		    }
 		    if (tracingcond)
-			tracemodcond(name, strs, ctype == COND_MODI);
+			tracemodcond(errname, strs, ctype == COND_MODI);
 		    return !cd->handler(strs, cd->condid);
 		} else {
 		    zwarnnam(fromtest,
diff --git a/Test/C02cond.ztst b/Test/C02cond.ztst
index bc565e8b6..a1b30307a 100644
--- a/Test/C02cond.ztst
+++ b/Test/C02cond.ztst
@@ -457,6 +457,16 @@ F:scenario if you encounter it.
 >in conjunction: 3
 ?(eval):6: no such option: invalidoption
 
+  if zmodload zsh/example &> /dev/null; then
+    function -T { [[ -len foo 3 ]] }
+    function -T { [[ ex -ex ample ]] }
+  else
+    ZTST_skip='the zsh/example module is not available'
+  fi
+-:regression test: module condition name untokenised in xtrace output
+?+(anon):0> [[ -len foo 3 ]]
+?+(anon):0> [[ ex -ex ample ]]
+
 %clean
   # This works around a bug in rm -f in some versions of Cygwin
   chmod 644 unmodish




Messages sorted by: Reverse Date, Date, Thread, Author