23 unsigned int i, test_len;
24 unsigned int single_quotation=0;
25 unsigned int double_quotation=0;
28 if(str1==NULL)
return((
char*)NULL);
29 if(str2==NULL)
return((
char*)str1);
30 test_len=strlen(str2);
if(test_len<1)
return((
char*)str1);
31 for(i=0, cptr=(
char*)str1; i<strlen(str1); i++, cptr++) {
33 if(single_quotation==0) single_quotation=1;
else single_quotation=0;
37 if(double_quotation==0) double_quotation=1;
else double_quotation=0;
40 if(single_quotation==1 || double_quotation==1)
continue;
41 if(strncmp(cptr, str2, test_len)==0)
return(cptr);
64 if(str1==NULL || maxlen<1)
return(0);
65 str1[0]=(char)0;
if(str2==NULL || strlen(str2)<1)
return(0);
66 cptr=(
char*)str2; cptr+=strspn(str2,
"\"\'\t\n\r ");
67 strncpy(str1, cptr, maxlen-1); str1[maxlen-1]=(char)0;
68 i=strlen(str1);
if(i<1)
return(0);
71 if(*cptr!=
'\"' && *cptr!=
'\'' && *cptr!=
'\t' && *cptr!=
'\n' &&
72 *cptr!=
'\r' && *cptr!=
' ')
74 i--; str1[i]=(char)0; cptr--;