Document the DJGPP status.
[p5sagit/p5-mst-13.2.git] / sv.c
diff --git a/sv.c b/sv.c
index 93e7bb5..2c31193 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -5884,16 +5884,19 @@ screamer2:
            /* Accomodate broken VAXC compiler, which applies U8 cast to
             * both args of ?: operator, causing EOF to change into 255
             */
-           if (cnt > 0) { i = (U8)buf[cnt - 1]; } else { i = EOF; }
-       }
-
-       if (cnt > 0) {
-           if (append)
-               sv_catpvn(sv, (char *) buf, cnt);
+           if (cnt > 0)
+                i = (U8)buf[cnt - 1];
            else
-               sv_setpvn(sv, (char *) buf, cnt);
+                i = EOF;
        }
 
+       if (cnt < 0)
+           cnt = 0;  /* we do need to re-set the sv even when cnt <= 0 */
+       if (append)
+            sv_catpvn(sv, (char *) buf, cnt);
+       else
+            sv_setpvn(sv, (char *) buf, cnt);
+
        if (i != EOF &&                 /* joy */
            (!rslen ||
             SvCUR(sv) < rslen ||
@@ -7774,7 +7777,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV
     We allow format specification elements in this order:
        \d+\$              explicit format parameter index
        [-+ 0#]+           flags
-       \*?(\d+\$)?v       vector with optional (optionally specified) arg
+       v|*(\d+\$)?v       vector with optional (optionally specified) arg
        \d+|\*(\d+\$)?     width using optional (optionally specified) arg
        \.(\d*|\*(\d+\$)?) precision using optional (optionally specified) arg
        [hlqLV]            size
@@ -7886,7 +7889,10 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV
            q++;
            if (*q == '*') {
                q++;
-               if (EXPECT_NUMBER(q, epix) && *q++ != '$') /* epix currently unused */
+               if (EXPECT_NUMBER(q, epix) && *q++ != '$')
+                   goto unknown;
+               /* XXX: todo, support specified precision parameter */
+               if (epix)
                    goto unknown;
                if (args)
                    i = va_arg(*args, int);