Change 11106 by jhi@alpha on 2001/07/02 19:18:28

        Subject: Re: [PATCH 5.6.1] OS/2 cwd
        From: Ilya Zakharevich <[EMAIL PROTECTED]>
        Date: Mon, 2 Jul 2001 15:45:41 -0400
        Message-ID: <[EMAIL PROTECTED]>

Affected files ...

... //depot/perl/os2/os2.c#51 edit

Differences ...

==== //depot/perl/os2/os2.c#51 (text) ====
Index: perl/os2/os2.c
--- perl/os2/os2.c.~1~  Mon Jul  2 13:30:06 2001
+++ perl/os2/os2.c      Mon Jul  2 13:30:06 2001
@@ -2074,17 +2074,22 @@
            l--;
        ST(0) = sv_newmortal();
        sv_setpvn( sv = (SV*)ST(0), RETVAL, l);
-       /* Remove duplicate slashes */
-       s = t = 1 + SvPV_force(sv, n_a);
+       /* Remove duplicate slashes, skipping the first three, which
+          may be parts of a server-based path */
+       s = t = 3 + SvPV_force(sv, n_a);
        e = SvEND(sv);
+       /* Do not worry about multibyte chars here, this would contradict the
+          eventual UTFization, and currently most other places break too... */
        while (s < e) {
            if (s[0] == t[-1] && s[0] == '/')
                s++;                            /* Skip duplicate / */
            else
                *t++ = *s++;
        }
-       *s = 0;
-       SvCUR_set(sv, s - SvPVX(sv));
+       if (t < e) {
+           *t = 0;
+           SvCUR_set(sv, t - SvPVX(sv));
+       }
     }
     XSRETURN(1);
 }
End of Patch.

Reply via email to