while (*cmd && isSPACE(*cmd))
cmd++;
- if (strnEQ (cmd,"/bin/sh",7) && isSPACE (cmd[7]))
+ if (strBEGINs (cmd,"/bin/sh") && isSPACE (cmd[7]))
cmd+=5;
/* save an extra exec if possible */
goto doshell;
if (*cmd=='.' && isSPACE (cmd[1]))
goto doshell;
- if (strnEQ (cmd,"exec",4) && isSPACE (cmd[4]))
+ if (strBEGINs (cmd,"exec") && isSPACE (cmd[4]))
goto doshell;
for (s=cmd; *s && isALPHA (*s); s++) ; /* catch VAR=val gizmo */
if (*s=='=')
while (*cmd && isSPACE(*cmd))
cmd++;
- if (strnEQ (cmd,"/bin/sh",7) && isSPACE (cmd[7]))
+ if (strBEGINs (cmd,"/bin/sh") && isSPACE (cmd[7]))
cmd+=5;
/* save an extra exec if possible */
{
if (*cmd=='.' && isSPACE (cmd[1]))
goto doshell;
- if (strnEQ (cmd,"exec",4) && isSPACE (cmd[4]))
+ if (strBEGINs (cmd,"exec") && isSPACE (cmd[4]))
goto doshell;
for (s=cmd; *s && isALPHA (*s); s++) ; /* catch VAR=val gizmo */
if (*s=='=')
STRLEN len;
glob_t pglob;
- if (strnNE (name,"/dev/dosglob/",13))
+ if (! strBEGINs (name,"/dev/dosglob/"))
break;
if ((gi=searchfd (-1)) == NULL)
break;
use DynaLoader ();
use Exporter ();
-$VERSION = '2.42';
+$VERSION = '2.43';
@ISA = qw( Exporter DynaLoader IO::File );
@EXPORT = qw( &O_APPEND &O_CREAT &O_EXCL &O_NDELAY &O_NOWAIT
&O_RDONLY &O_RDWR &O_TRUNC &O_WRONLY );
static bool
constant(char *name, IV *pval)
{
- if (strnNE(name, "O_", 2)) return FALSE;
+ if (! strBEGINs(name, "O_")) return FALSE;
if (strEQ(name, "O_APPEND"))
#ifdef O_APPEND
SP -= retcnt;
errsv = ERRSV;
errstr = SvPV_nolen(errsv);
- if(strnEQ(errstr, "Undefined subroutine &main:: called at",
- sizeof("Undefined subroutine &main:: called at") - 1)) {
+ if(strBEGINs(errstr, "Undefined subroutine &main:: called at")) {
PUSHMARK(SP);
retcnt = call_sv((SV*)i_sub, 0); /* call again to increase counter */
SPAGAIN;
SP -= retcnt;
errsv = ERRSV;
errstr = SvPV_nolen(errsv);
- if(strnEQ(errstr, "Can't use an undefined value as a subroutine reference at",
- sizeof("Can't use an undefined value as a subroutine reference at") - 1)) {
+ if(strBEGINs(errstr, "Can't use an undefined value as a subroutine reference at")) {
PUSHMARK(SP);
retcnt = call_sv((SV*)i_sub, 0); /* call again to increase counter */
SPAGAIN;
SP -= retcnt;
errsv = ERRSV;
errstr = SvPV_nolen(errsv);
- if(strnEQ(errstr, "Not a CODE reference at",
- sizeof("Not a CODE reference at") - 1)) {
+ if(strBEGINs(errstr, "Not a CODE reference at")) {
PUSHMARK(SP);
retcnt = call_sv((SV*)i_sub, 0); /* call again to increase counter */
SPAGAIN;
}
/* $proto->MyClass::method() and $proto->MyClass::SUPER::method() */
- if (nsplit >= 9 && strnEQ(method+nsplit-9, "::SUPER::", 9)) {
+ if (nsplit >= 9 && strBEGINs(method+nsplit-9, "::SUPER::")) {
rclass = newSVpvn_share(method, utf8*(nsplit-9), 0);
new_op = newMETHOP_named(OP_METHOD_REDIR_SUPER, 0, methsv);
} else {
#endif
rsfp = PerlIO_open(scriptname,PERL_SCRIPT_MODE);
#ifdef FAKE_BIT_BUCKET
- if (memEQ(scriptname, FAKE_BIT_BUCKET_PREFIX,
- sizeof(FAKE_BIT_BUCKET_PREFIX) - 1)
- && strlen(scriptname) == sizeof(tmpname) - 1) {
+ if ( strBEGINs(scriptname, FAKE_BIT_BUCKET_PREFIX)
+ && strlen(scriptname) == sizeof(tmpname) - 1)
+ {
unlink(scriptname);
}
scriptname = BIT_BUCKET;
if (SvGMAGICAL(TOPs)) SETs(sv_mortalcopy(TOPs));
if (SvPOK(TOPs) && SvCUR(TOPs) >= 7) {
const char * s = SvPVX_const(TOPs);
- if (strnEQ(s, "CORE::", 6)) {
+ if (strBEGINs(s, "CORE::")) {
const int code = keyword(s + 6, SvCUR(TOPs) - 6, 1);
if (!code)
DIE(aTHX_ "Can't find an opnumber for \"%" UTF8f "\"",
*t++ = ' ';
}
s1 = t - 3;
- if (strnEQ(s1," ",3)) {
+ if (strBEGINs(s1," ")) {
while (s1 > SvPVX_const(PL_formtarget) && isSPACE(s1[-1]))
s1--;
}
PERL_ARGS_ASSERT_MUL128;
- if (!strnEQ(s, "0000", 4)) { /* need to grow sv */
+ if (! strBEGINs(s, "0000")) { /* need to grow sv */
SV * const tmpNew = newSVpvs("0000000000");
sv_catsv(tmpNew, sv);
}
else if(!(endbrace == RExC_parse /* nothing between the {} */
|| (endbrace - RExC_parse >= 2 /* U+ (bad hex is checked... */
- && strnEQ(RExC_parse, "U+", 2)))) /* ... below for a better
- error msg) */
+ && strBEGINs(RExC_parse, "U+")))) /* ... below for a better
+ error msg) */
{
RExC_parse = endbrace; /* position msg's '<--HERE' */
vFAIL("\\N{NAME} must be resolved by the lexer");
}
else {
I32 tmp;
- if (strnEQ(s, "L\\u", 3) || strnEQ(s, "U\\l", 3))
+ if (strBEGINs(s, "L\\u") || strBEGINs(s, "U\\l"))
tmp = *s, *s = s[2], s[2] = (char)tmp; /* misordered... */
if ((*s == 'L' || *s == 'U' || *s == 'F')
&& (strpbrk(PL_lex_casestack, "LUF")))
const char * pch1;
ret_val = 0;
- if (strncmp(path,"\"^UP^",5) != 0) {
+ if (! strBEGINs(path,"\"^UP^")) {
pch1 = strchr(path, '/');
if (pch1 != NULL)
ret_val = 1;
if (!cp1) cp1 = strstr(my_esa,"]<");
dirlen = cp1 - my_esa;
memcpy(buf, my_esa, dirlen);
- if (!strncmp(cp1+2,"000000]",7)) {
+ if (strBEGINs(cp1+2,"000000]")) {
buf[dirlen-1] = '\0';
/* fix-me Not full ODS-5, just extra dots in directories for now */
cp1 = buf + dirlen - 1;
* glob passes filenames with trailing '\n' and expects this preserved.
*/
if (decc_posix_compliant_pathnames) {
- if (strncmp(spec, "\"^UP^", 5) == 0) {
+ if (! strBEGINs(spec, "\"^UP^")) {
char * uspec;
char *tunix;
int tunix_len;
#if __CRTL_VER >= 80200000
/* If not a posix spec already, convert it */
if (decc_posix_compliant_pathnames) {
- if (strncmp(unixpath,"\"^UP^",5) != 0) {
+ if (! strBEGINs(unixpath,"\"^UP^")) {
sprintf(vmspath,"\"^UP^%s\"",unixpath);
}
else {
/* on any failure, returned the POSIX ^UP^ filespec */
if (!(sts & 1)) {
/* This can happen if user does not have permission to read directories */
- if (strncmp(unixpath,"\"^UP^",5) != 0)
+ if (! strBEGINs(unixpath,"\"^UP^"))
sprintf(vmspath,"\"^UP^%s\"",unixpath);
else
my_strlcpy(vmspath, unixpath, vmspath_len + 1);
quoted = 0;
/* This could have a "^UP^ on the front */
- if (strncmp(unixptr,"\"^UP^",5) == 0) {
+ if (strBEGINs(unixptr,"\"^UP^")) {
quoted = 1;
unixptr+= 5;
unixlen-= 5;
/*--------------------------------------------------*/
#if __CRTL_VER >= 80200000
if (decc_posix_compliant_pathnames) {
- if (strncmp(path,"\"^UP^",5) == 0) {
+ if (strBEGINs(path,"\"^UP^")) {
posix_to_vmsspec_hardway(rslt, rslt_len, path, dir_flag, utf8_flag);
return rslt;
}
islnm = simple_trnlnm(rslt,trndev,VMS_MAXRSS-1);
}
else if (strEQ(rslt,"dev")) {
- if (strncmp(cp2,"/null", 5) == 0) {
+ if (strBEGINs(cp2,"/null")) {
if ((cp2[5] == 0) || (cp2[5] == '/')) {
strcpy(rslt,"NLA0");
cp1 = rslt + 4;
is_null_device(const char *name)
{
if (decc_bug_devnull != 0) {
- if (strncmp("/dev/null", name, 9) == 0)
+ if (strBEGINs(name, "/dev/null"))
return 1;
}
/* The VMS null device is named "_NLA0:", usually abbreviated as "NL:".
else {
/* last ditch: allow any environment variables that begin with 'PERL'
to be obtained from the registry, if found there */
- if (strncmp(name, "PERL", 4) == 0)
+ if (strBEGINs(name, "PERL"))
(void)get_regstr(name, &curitem);
}
#endif