Few more IDE/editor nits from p5p.
[p5sagit/p5-mst-13.2.git] / pp_sys.c
index c1857ae..ca4d1bd 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -1,6 +1,6 @@
 /*    pp_sys.c
  *
- *    Copyright (c) 1991-2000, Larry Wall
+ *    Copyright (c) 1991-2001, Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
@@ -1236,6 +1236,8 @@ PP(pp_leavewrite)
 
     DEBUG_f(PerlIO_printf(Perl_debug_log, "left=%ld, todo=%ld\n",
          (long)IoLINES_LEFT(io), (long)FmLINES(PL_formtarget)));
+    if (!io || !ofp)
+       goto forget_top;
     if (IoLINES_LEFT(io) < FmLINES(PL_formtarget) &&
        PL_formtarget != PL_toptarget)
     {
@@ -1356,6 +1358,7 @@ PP(pp_leavewrite)
            PUSHs(&PL_sv_yes);
        }
     }
+bad_ofp:
     PL_formtarget = PL_bodytarget;
     PUTBACK;
     return pop_return();
@@ -3275,12 +3278,12 @@ PP(pp_fttext)
                continue;
 #endif
            /* utf8 characters don't count as odd */
-           if (*s & 0x40) {
+           if (UTF8_IS_START(*s)) {
                int ulen = UTF8SKIP(s);
                if (ulen < len - i) {
                    int j;
                    for (j = 1; j < ulen; j++) {
-                       if ((s[j] & 0xc0) != 0x80)
+                       if (!UTF8_IS_CONTINUATION(s[j]))
                            goto not_utf8;
                    }
                    --ulen;     /* loop does extra increment */