Earnie Boyd dixit:

>One can use either method as long as a method doesn't give unexpected
>results to the end user.  If you translate PATH to / then you need to
>translate it back to \ before spawning a process because Windows OS
>will not do the right thing with / in PATH.

Hrm. Well, maybe for mksh/Win32.

>I would suggest training echo to not translate the escaped characters
>of an environment variable.

“echo” just sees the string. By default, Korn Shell echo has
historically been “rich”, but I’d say we can make -E the default
on native Win32.

Michael, this is the patch (in R39) if you agree:

--- funcs.c~    Thu Jul 30 19:11:11 2009
+++ funcs.c     Wed Sep 11 13:09:52 2013
@@ -365,7 +365,7 @@ c_print(const char **wp)
        char *xp;
 
        if (wp[0][0] == 'e') {  /* echo command */
-               int nflags = flags;
+               int nflags = (flags = PO_NL);
 
                /* A compromise between sysV and BSD echo commands:
                 * escape sequences are enabled by default, and
@@ -375,6 +375,7 @@ c_print(const char **wp)
                 * Different from sysV echo since options are recognised,
                 * different from BSD echo since escape sequences are enabled
                 * by default.
+                * mksh/Win32 change: Disable escape sequences by default.
                 */
                wp += 1;
                if (Flag(FPOSIX)) {

>My interest in mksh-w32 is one of a replacement for MSYS.  Getting rid
>of the man-in-the-middle runtime would help speed up operations and
>the less work the binary does spawning the better.  At some point in

Right.

>the distant future I'll take a look at the code and try to help out.

That’d be great!

Thanks,
//mirabilos
-- 
20:49⎜«Natureshadow» Oops, jetzt hab ich mir doch glatt beim Trinken
     ⎜    Mineralwasser ins Ohr gekippt…
21:04⎜«mirabilos» ist das siggbar?      █ PS: سمَـَّوُوُحخ ̷̴خ ̷̴خ ̷̴خ امارتيخ 
̷̴خ
21:05⎜«Natureshadow» mirabilos: was sollte dich davon abhalten…

Reply via email to