mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-03-19 17:30:27 +08:00
fix ncuriparse error,Correctly remove leading and trailing whitespace
This commit is contained in:
parent
f0b7cebb90
commit
bfdef0eecb
@ -173,7 +173,10 @@ ncuriparse(const char* uri0, NCURI** durip)
|
||||
2. convert all '\\' -> '\' (Temp hack to remove escape characters
|
||||
inserted by Windows or MinGW)
|
||||
*/
|
||||
for(q=uri,p=uri;*p;p++) {if((*p == '\\' && p[1] == '\\') || *p < ' ') {continue;} else {*q++ = *p;}}
|
||||
p = uri;
|
||||
while(*p == ' ') p++;
|
||||
for(q=uri;*p;p++) {if((*p == '\\' && p[1] == '\\')) {continue;} else {*q++ = *p;}}
|
||||
while(*(q - 1) == ' ' && (q - 1) >= uri) q--;
|
||||
*q = '\0';
|
||||
|
||||
p = uri;
|
||||
|
Loading…
x
Reference in New Issue
Block a user