• R/O
  • SSH
  • HTTPS

yash: Commit


Commit MetaInfo

Revision3992 (tree)
Time2019-06-06 00:41:45
Authormagicant

Log Message

Expand ""$* to an empty string (#39280)

The words ""$*, ""$@, $*"", and $@"" should expand to an empty string
rather than nothing when there are no positional parameters.

Change Summary

Incremental Difference

--- yash/trunk/NEWS (revision 3991)
+++ yash/trunk/NEWS (revision 3992)
@@ -10,6 +10,9 @@
1010 ----------------------------------------------------------------------
1111 Yash 2.49
1212
13+ * Expansion of ""$*, ""$@, $*"", and $@"" now correctly yields an
14+ empty string rather than nothing when there are no positional
15+ parameters.
1316 * The $RANDOM variable was expanding to a value larger than 32767
1417 on some systems.
1518 * The "\e" escape sequence was not working in the "echo" built-in.
--- yash/trunk/expand.c (revision 3991)
+++ yash/trunk/expand.c (revision 3992)
@@ -1,6 +1,6 @@
11 /* Yash: yet another shell */
22 /* expand.c: word expansion */
3-/* (C) 2007-2018 magicant */
3+/* (C) 2007-2019 magicant */
44
55 /* This program is free software: you can redistribute it and/or modify
66 * it under the terms of the GNU General Public License as published by
@@ -907,7 +907,8 @@
907907
908908 /* add the elements of `values' to `e->valuelist' */
909909 if (values[0] == NULL) {
910- e->zeroword = true;
910+ if (indq)
911+ e->zeroword = true;
911912 } else {
912913 /* add the first element */
913914 wb_catfree(&e->valuebuf, values[0]);
Show on old repository browser