mirror of
https://github.com/curl/curl.git
synced 2025-03-31 16:00:35 +08:00
dedotdot: fixed output for ".." and "." only input
Found when updating test 1395, which I did to increase test coverage of this source file... Closes #1535
This commit is contained in:
parent
10e02bc36a
commit
cfd3e8f399
@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
@ -147,6 +147,7 @@ char *Curl_dedotdotify(const char *input)
|
||||
|
||||
else if(!strcmp(".", clone) || !strcmp("..", clone)) {
|
||||
*clone=0;
|
||||
*out=0;
|
||||
}
|
||||
|
||||
else {
|
||||
|
@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
@ -65,6 +65,13 @@ UNITTEST_START
|
||||
{ "/", "/" },
|
||||
{ "", "" },
|
||||
{ "/.../", "/.../" },
|
||||
{ "./moo", "moo" },
|
||||
{ "../moo", "moo" },
|
||||
{ "/.", "/" },
|
||||
{ "/..", "/" },
|
||||
{ "/moo/..", "/" },
|
||||
{ "..", "" },
|
||||
{ ".", "" },
|
||||
};
|
||||
|
||||
for(i=0; i < sizeof(pairs)/sizeof(pairs[0]); i++) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user