mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2024-12-22 16:58:55 +00:00
Fixed parse_string function in write_multiblock.cc
This commit is contained in:
parent
34ea2acd75
commit
23fe6f4dee
@ -105,19 +105,17 @@ static bool parse_string(const char* pstr, char delim, strlist_t& strlist)
|
||||
if(!pstr){
|
||||
return false;
|
||||
}
|
||||
char* ptmp = strdup(pstr);
|
||||
char* pbup = ptmp;
|
||||
for(char* pfound = strchr(ptmp, delim); pfound; pfound = strchr(ptmp, delim)){
|
||||
*pfound = '\0';
|
||||
if(0 < strlen(ptmp)){
|
||||
strlist.push_back(std::string(ptmp));
|
||||
std::string strAll(pstr);
|
||||
while(!strAll.empty()){
|
||||
size_t pos = strAll.find_first_of(delim);
|
||||
if(std::string::npos != pos){
|
||||
strlist.push_back(strAll.substr(0, pos));
|
||||
strAll = strAll.substr(pos + 1);
|
||||
}else{
|
||||
strlist.push_back(strAll);
|
||||
strAll.erase();
|
||||
}
|
||||
ptmp = ++pfound;
|
||||
}
|
||||
if(0 < strlen(ptmp)){
|
||||
strlist.push_back(std::string(ptmp));
|
||||
}
|
||||
free(pbup);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user