Merge pull request #753 from cfz/master

fix xpath selector in bucket listing
This commit is contained in:
Takeshi Nakatani 2018-05-02 12:04:12 +09:00 committed by GitHub
commit d052dc0b9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2724,7 +2724,7 @@ static xmlChar* get_base_exp(xmlDocPtr doc, const char* exp)
{
xmlXPathObjectPtr marker_xp;
string xmlnsurl;
string exp_string = "//";
string exp_string;
if(!doc){
return NULL;
@ -2733,8 +2733,11 @@ static xmlChar* get_base_exp(xmlDocPtr doc, const char* exp)
if(!noxmlns && GetXmlNsUrl(doc, xmlnsurl)){
xmlXPathRegisterNs(ctx, (xmlChar*)"s3", (xmlChar*)xmlnsurl.c_str());
exp_string += "s3:";
exp_string = "/s3:ListBucketResult/s3:";
} else {
exp_string = "/ListBucketResult/";
}
exp_string += exp;
if(NULL == (marker_xp = xmlXPathEvalExpression((xmlChar *)exp_string.c_str(), ctx))){