Lines 281-287
Link Here
|
281 |
DBC_RETVAL_IF_FAIL(str!=NULL,NULL); |
281 |
DBC_RETVAL_IF_FAIL(str!=NULL,NULL); |
282 |
DBC_RETVAL_IF_FAIL(what!=NULL,NULL); |
282 |
DBC_RETVAL_IF_FAIL(what!=NULL,NULL); |
283 |
while (*str){ |
283 |
while (*str){ |
284 |
char *a=index(what,*str); |
284 |
const char *a=index(what,*str); |
285 |
if (a) return(str); |
285 |
if (a) return(str); |
286 |
str++; |
286 |
str++; |
287 |
}; |
287 |
}; |
Lines 472-487
Link Here
|
472 |
char *escape_char(const char *where,char what,char bywhat){ |
472 |
char *escape_char(const char *where,char what,char bywhat){ |
473 |
DBC_RETVAL_IF_FAIL(where!=NULL,NULL); |
473 |
DBC_RETVAL_IF_FAIL(where!=NULL,NULL); |
474 |
int num=0; |
474 |
int num=0; |
475 |
char *tmp=index(where,what); |
475 |
char *tmp = (char *) index(where,what); |
476 |
while(tmp){ |
476 |
while(tmp){ |
477 |
num+=1; |
477 |
num+=1; |
478 |
tmp=index(tmp+1,what); |
478 |
tmp = (char *) index(tmp+1,what); |
479 |
}; |
479 |
}; |
480 |
if (num){ |
480 |
if (num){ |
481 |
char *rvalue=new char[strlen(where)+num*2+1]; |
481 |
char *rvalue=new char[strlen(where)+num*2+1]; |
482 |
*rvalue=0; |
482 |
*rvalue=0; |
483 |
char *r=rvalue; |
483 |
char *r=rvalue; |
484 |
tmp=index(where,what); |
484 |
tmp = (char *) index(where,what); |
485 |
while(tmp){ |
485 |
while(tmp){ |
486 |
if (tmp-where) |
486 |
if (tmp-where) |
487 |
memcpy(r,where,tmp-where); |
487 |
memcpy(r,where,tmp-where); |
Lines 490-496
Link Here
|
490 |
r[1]=what; |
490 |
r[1]=what; |
491 |
r+=2; |
491 |
r+=2; |
492 |
where=tmp+1; |
492 |
where=tmp+1; |
493 |
tmp=index(where,what); |
493 |
tmp = (char *) index(where,what); |
494 |
}; |
494 |
}; |
495 |
*r=0; |
495 |
*r=0; |
496 |
if (*where) |
496 |
if (*where) |
Lines 962-978
Link Here
|
962 |
DBC_RETVAL_IF_FAIL(a!=NULL,NULL); |
962 |
DBC_RETVAL_IF_FAIL(a!=NULL,NULL); |
963 |
DBC_RETVAL_IF_FAIL(b!=NULL,NULL); |
963 |
DBC_RETVAL_IF_FAIL(b!=NULL,NULL); |
964 |
int i=0; |
964 |
int i=0; |
965 |
char *temp=index(b,'/'); |
965 |
char *temp = (char *) index(b,'/'); |
966 |
while (temp){ |
966 |
while (temp){ |
967 |
while (*temp=='/') temp+=1; |
967 |
while (*temp=='/') temp+=1; |
968 |
temp=index(temp,'/'); |
968 |
temp=index(temp,'/'); |
969 |
i+=1; |
969 |
i+=1; |
970 |
}; |
970 |
}; |
971 |
i-=1; |
971 |
i-=1; |
972 |
temp=rindex(a,'/'); |
972 |
temp = (char *) rindex(a,'/'); |
973 |
while (temp && i>0){ |
973 |
while (temp && i>0){ |
974 |
*temp=0; |
974 |
*temp=0; |
975 |
char *tmp=rindex(a,'/'); |
975 |
char *tmp = (char *) rindex(a,'/'); |
976 |
*temp='/'; |
976 |
*temp='/'; |
977 |
temp=tmp; |
977 |
temp=tmp; |
978 |
i-=1; |
978 |
i-=1; |