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 (*(cp2+1) == ']' || *(cp2+1) == '>') {
while (*(cp2+1) == ']' || *(cp2+1) == '>' ||
*(cp2+1) == '[' || *(cp2+1) == '<') cp2++;
- if (memEQs(cp2,"[000000") && (*(cp2+7) == ']' ||
+ if (memEQs(cp2,7,"[000000") && (*(cp2+7) == ']' ||
*(cp2+7) == '>' || *(cp2+7) == '.')) cp2 += 7;
}
else if ( *(cp2+1) == '.' && *(cp2+2) == '.') {
#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;
sts = slash_dev_special_to_vms(unixptr, vmspath, vmspath_len);
if (sts == SS$_NORMAL)
return SS$_NORMAL;
- }
}
sts = posix_root_to_vms(esa, vmspath_len, vmspath, utf8_fl);
}
/*--------------------------------------------------*/
#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:".