• R/O
  • SSH
  • HTTPS

yash: Commit


Commit MetaInfo

Revision3956 (tree)
Time2019-01-05 16:03:30
Authormagicant

Log Message

echo: Recognize "\e" escape sequence

Change Summary

Incremental Difference

--- yash/trunk/NEWS (revision 3955)
+++ yash/trunk/NEWS (revision 3956)
@@ -8,6 +8,11 @@
88 x: new bug
99
1010 ----------------------------------------------------------------------
11+Yash 2.49
12+
13+ * The "\e" escape sequence was not working in the "echo" built-in.
14+
15+----------------------------------------------------------------------
1116 Yash 2.48
1217
1318 + The double-bracket command (the [[ ... ]] syntax)
--- yash/trunk/builtins/printf.c (revision 3955)
+++ yash/trunk/builtins/printf.c (revision 3956)
@@ -1,6 +1,6 @@
11 /* Yash: yet another shell */
22 /* printf.c: the echo/printf built-ins */
3-/* (C) 2007-2016 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
@@ -225,15 +225,16 @@
225225 } else {
226226 switch (s[1]) {
227227 wchar_t c;
228- case L'a': c = L'\a'; goto print_char;
229- case L'b': c = L'\b'; goto print_char;
228+ case L'a': c = L'\a'; goto print_char;
229+ case L'b': c = L'\b'; goto print_char;
230230 case L'c': return PR_OK_END;
231- case L'f': c = L'\f'; goto print_char;
232- case L'n': c = L'\n'; goto print_char;
233- case L'r': c = L'\r'; goto print_char;
234- case L't': c = L'\t'; goto print_char;
235- case L'v': c = L'\v'; goto print_char;
236- case L'\\': c = L'\\'; goto print_char;
231+ case L'e': c = L'\033'; goto print_char;
232+ case L'f': c = L'\f'; goto print_char;
233+ case L'n': c = L'\n'; goto print_char;
234+ case L'r': c = L'\r'; goto print_char;
235+ case L't': c = L'\t'; goto print_char;
236+ case L'v': c = L'\v'; goto print_char;
237+ case L'\\': c = L'\\'; goto print_char;
237238 print_char:
238239 if (!sb_wccat(buf, c, st))
239240 return PR_ERROR;
Show on old repository browser