libidav/utils.c

changeset 757
7ced4052e8ca
parent 747
efbd59642577
child 775
e5909dff0dbf
equal deleted inserted replaced
756:ea0e059bae72 757:7ced4052e8ca
457 457
458 if(seg_len > 0) { 458 if(seg_len > 0) {
459 cxstring seg = cx_strn(seg_ptr, seg_len); 459 cxstring seg = cx_strn(seg_ptr, seg_len);
460 if(!cx_strcmp(seg, CX_STR(".."))) { 460 if(!cx_strcmp(seg, CX_STR(".."))) {
461 for(int j=buf.pos;j>=0;j--) { 461 for(int j=buf.pos;j>=0;j--) {
462 char t = buf.space[j]; 462 char t = j < buf.pos ? buf.space[j] : 0;
463 if(IS_PATH_SEPARATOR(t) || j == 0) { 463 if(IS_PATH_SEPARATOR(t) || j == 0) {
464 buf.pos = j; 464 buf.pos = j;
465 buf.size = j; 465 buf.size = j;
466 buf.space[j] = 0; 466 buf.space[j] = 0;
467 add_separator = IS_PATH_SEPARATOR(t) ? 1 : 0; 467 add_separator = IS_PATH_SEPARATOR(t) ? 1 : 0;

mercurial