Op 15-04-18 om 03:41 schreef Philip Guenther:
On Sun, 15 Apr 2018, Klemens Nanni wrote:
It also badly effects non-empty cases:
...
        $ ./obj/ksh -c alias
        autoload=''
        functions=''


Hah!  The original diff i actually broken (it tests the wrong variable)
but I fixed that by accident when I manually made the diff in my tree!

So, uh, I'm no longer fine with the original diff...

D'oh!

That's embarrassing. Sorry about that. :-/

- M.

Index: misc.c
===================================================================
RCS file: /cvs/src/bin/ksh/misc.c,v
retrieving revision 1.70
diff -u -p -r1.70 misc.c
--- misc.c      9 Apr 2018 17:53:36 -0000       1.70
+++ misc.c      15 Apr 2018 02:06:55 -0000
@@ -966,6 +966,12 @@ print_value_quoted(const char *s)
        const char *p;
        int inquote = 0;

+       /* Check for empty */
+       if (!*s) {
+               shprintf("''");
+               return;
+       }
+
        /* Test if any quotes are needed */
        for (p = s; *p; p++)
                if (ctype(*p, C_QUOTE))

Reply via email to