pike.git
/
src
/
combine_path.h
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/combine_path.h:206:
while(--tmp>=0) if(IS_SEP(index_shared_string(s->s, tmp))) break; tmp++; } else if (IS_SEP(index_shared_string(s->s, 0))) { tmp++; } if (tmp < abs) tmp = abs;
-
else
+
else
{
+
if (index_shared_string(s->s,tmp)=='.') {
if ((tmp+1 < s->s->len) &&
-
(index_shared_string(s->s,tmp)=='.') &&
+
(index_shared_string(s->s,tmp+1)=='.') && ( (tmp+2 == s->s->len) ||
-
IS_SEP(index_shared_string(s->s,tmp+2))))
+
IS_SEP(index_shared_string(s->s,tmp+2))))
{
break;
-
+
} else if ((tmp+1 == s->s->len) ||
+
IS_SEP(index_shared_string(s->s,tmp+1))) {
+
/* Previous is "." or "./".
+
* Replace it with "..".
+
*/
+
if (tmp+1 != s->s->len) {
+
/* Remove the separator. */
+
s->s->len--;
+
}
+
PUSH('.');
+
from += 2;
+
if (c3) {
+
PUSH('/');
+
from++;
+
}
+
#if COMBINE_PATH_DEBUG > 0
+
/* s->s->str[s->s->len]=0; */
+
fprintf(stderr,"combine_path(2), TO: %s[%d]\n",
+
s->s->str, s->s->len);
+
fprintf(stderr,"combine_path(2), FROM (%d): %s[%d]\n",
+
from, path.ptr+from, len-from);
+
#endif
+
continue;
+
}
+
}
+
}
from+=(c3? 3:2); s->s->len=tmp; s->known_shift=0; #if COMBINE_PATH_DEBUG > 0 /* s->s->str[s->s->len]=0; */ fprintf(stderr,"combine_path(1), TO: %s[%d]\n", s->s->str, s->s->len); fprintf(stderr,"combine_path(1), FROM (%d): %s[%d]\n",