/* The count here deliberately includes the NUL
that terminates the C string constant. This
embeds the opening NUL into the string. */
+ const char *splits = PL_splitstr;
sv_catpvn(PL_linestr, "our @F=split(q", 15);
- s = PL_splitstr;
do {
/* Need to \ \s */
- if (*s == '\\')
- sv_catpvn(PL_linestr, s, 1);
- sv_catpvn(PL_linestr, s, 1);
- } while (*s++);
+ if (*splits == '\\')
+ sv_catpvn(PL_linestr, splits, 1);
+ sv_catpvn(PL_linestr, splits, 1);
+ } while (*splits++);
/* This loop will embed the trailing NUL of
PL_linestr as the last thing it does before
terminating. */
if (*d++ == '-') {
bool switches_done = PL_doswitches;
do {
- if (*d == 'M' || *d == 'm') {
+ if (*d == 'M' || *d == 'm' || *d == 'C') {
char *m = d;
while (*d && !isSPACE(*d)) d++;
Perl_croak(aTHX_ "Too late for \"-%.*s\" option",
I32 len;
SV *tmpstr;
char term;
+ const char newline[] = "\n";
+ const char *found_newline;
register char *d;
register char *e;
char *peek;
s = olds;
}
#endif
- d = "\n";
- if (outer || !(d=ninstr(s,PL_bufend,d,d+1)))
- herewas = newSVpvn(s,PL_bufend-s);
- else
- s--, herewas = newSVpvn(s,d-s);
+ if ( outer || !(found_newline = ninstr(s,PL_bufend,newline,newline+1)) ) {
+ herewas = newSVpvn(s,PL_bufend-s);
+ }
+ else {
+ s--;
+ herewas = newSVpvn(s,found_newline-s);
+ }
s += SvCUR(herewas);
tmpstr = NEWSV(87,79);
else
lvalp->opval = Nullop;
- return s;
+ return (char *)s;
}
STATIC char *
if ((PL_bufend - next) >= 2 && *next == '=' && next[1] == '>' ) {
/* return string not v-string */
sv_setpvn(sv,(char *)s,pos-s);
- return pos;
+ return (char *)pos;
}
}
sv_magic(sv,NULL,PERL_MAGIC_vstring,(const char*)start, pos-start);
SvRMAGICAL_on(sv);
}
- return s;
+ return (char *)s;
}