• R/O
  • SSH
  • HTTPS

yash: 提交


Commit MetaInfo

修訂4081 (tree)
時間2020-09-24 14:18:23
作者magicant

Log Message

Correct quote removal in arithmetic expansion (#40738)

Change Summary

差異

--- yash/trunk/NEWS (revision 4080)
+++ yash/trunk/NEWS (revision 4081)
@@ -10,6 +10,9 @@
1010 ----------------------------------------------------------------------
1111 Yash 2.51
1212
13+ = Quote removal in arithmetic expansion has been modified to match
14+ the behavior defined in POSIX. It no longer allows things like
15+ $(("2" + \5)).
1316 * The "command" built-in with the -v or -V option was printing
1417 the pathnames of external commands with a redundant leading slash
1518 when the current working directory is "/" or "//".
--- yash/trunk/expand.c (revision 4080)
+++ yash/trunk/expand.c (revision 4081)
@@ -479,7 +479,7 @@
479479 s = exec_command_substitution(&w->wu_cmdsub);
480480 goto cat_s;
481481 case WT_ARITH:
482- s = expand_single(w->wu_arith, TT_NONE, Q_WORD, ES_NONE);
482+ s = expand_single(w->wu_arith, TT_NONE, Q_INDQ, ES_NONE);
483483 if (s != NULL)
484484 s = evaluate_arithmetic(s);
485485 cat_s:
Show on old repository browser