diff options
author | Yang Tse <yangsita@gmail.com> | 2013-07-11 13:29:20 +0200 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2013-07-11 13:31:07 +0200 |
commit | 5c6f12b9f2fe1d32f4fac8d7c15c01b92ec3a8d3 (patch) | |
tree | ad276df8508cf14aeaf057fbed4e30c156ef3a9b | |
parent | 2022b10e50c5387ee9f457390fb76f1467f9b9f6 (diff) |
dotdot.c: fix global declaration shadowing
-rw-r--r-- | lib/dotdot.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/lib/dotdot.c b/lib/dotdot.c index 95b636780..f8937789d 100644 --- a/lib/dotdot.c +++ b/lib/dotdot.c @@ -53,7 +53,7 @@ char *Curl_dedotdotify(char *input) char *clone; size_t clen = inlen; /* the length of the cloned input */ char *out = malloc(inlen+1); - char *outp; + char *outptr; char *orgclone; char *queryp; if(!out) @@ -66,7 +66,7 @@ char *Curl_dedotdotify(char *input) return NULL; } orgclone = clone; - outp = out; + outptr = out; /* * To handle query-parts properly, we must find it and remove it during the @@ -113,24 +113,24 @@ char *Curl_dedotdotify(char *input) clone+=3; clen-=3; /* remove the last segment from the output buffer */ - while(outp > out) { - outp--; - if(*outp == '/') + while(outptr > out) { + outptr--; + if(*outptr == '/') break; } - *outp = 0; /* zero-terminate where it stops */ + *outptr = 0; /* zero-terminate where it stops */ } else if(!strcmp("/..", clone)) { clone[2]='/'; clone+=2; clen-=2; /* remove the last segment from the output buffer */ - while(outp > out) { - outp--; - if(*outp == '/') + while(outptr > out) { + outptr--; + if(*outptr == '/') break; } - *outp = 0; /* zero-terminate where it stops */ + *outptr = 0; /* zero-terminate where it stops */ } /* D. if the input buffer consists only of "." or "..", then remove @@ -147,10 +147,10 @@ char *Curl_dedotdotify(char *input) character or the end of the input buffer. */ do { - *outp++ = *clone++; + *outptr++ = *clone++; clen--; } while(*clone && (*clone != '/')); - *outp=0; + *outptr = 0; } } while(*clone); @@ -162,7 +162,7 @@ char *Curl_dedotdotify(char *input) from the correct index. */ size_t oindex = queryp - orgclone; qlen = strlen(&input[oindex]); - memcpy(outp, &input[oindex], qlen+1); /* include the ending zero byte */ + memcpy(outptr, &input[oindex], qlen+1); /* include the ending zero byte */ } free(orgclone); |