We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d535a43 commit 60923ecCopy full SHA for 60923ec
1 file changed
cpp/src/graphar/graph_info.cc
@@ -1103,8 +1103,10 @@ namespace {
1103
static std::string PathToDirectory(const std::string& path) {
1104
if (path.rfind("s3://", 0) == 0) {
1105
size_t t = path.find_last_of('?');
1106
- std::string prefix = path.substr(0, t);
1107
- std::string suffix = path.substr(t);
+
+ std::string prefix = (t == std::string::npos) ? path : path.substr(0, t);
1108
+ std::string suffix = (t == std::string::npos) ? "" : path.substr(t);
1109
1110
const size_t last_slash_idx = prefix.rfind('/');
1111
if (std::string::npos != last_slash_idx) {
1112
return prefix.substr(0, last_slash_idx + 1) + suffix;
0 commit comments