Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

zsh-3.0-pre6 zstrtol broken



>From utils.c:

>   /* Convert string to long.  This function (without the z) *
>    * is contained in the ANSI standard C library, but a lot *
>    * of them seem to be broken.                             */

... and so is zstrtol; it does not skip leading whitespace.

--- Src/utils.c.orig    Sun Aug  4 15:39:19 1996
+++ Src/utils.c Mon Aug  5 14:04:28 1996
@@ -1035,6 +1035,8 @@
 zstrtol(const char *s, char **t, int base)
 {
     long ret = 0;
+
+    while (inblank(*s)) s++;
  
     if (!base)
        if (*s != '0')



Messages sorted by: Reverse Date, Date, Thread, Author