We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b9b2a2e commit 9bfc0b9Copy full SHA for 9bfc0b9
1 file changed
pystring.cpp
@@ -1089,7 +1089,7 @@ namespace path
1089
void splitdrive_nt(std::string & drivespec, std::string & pathspec,
1090
const std::string & p)
1091
{
1092
- if(pystring::slice(p, 1, 2) == colon)
+ if (p.size() >= 2 && p[1] == ':')
1093
1094
std::string path = p; // In case drivespec == p
1095
drivespec = pystring::slice(path, 0, 2);
@@ -1209,8 +1209,8 @@ namespace path
1209
// 4. join('c:', 'd:/') = 'd:/'
1210
// 5. join('c:/', 'd:/') = 'd:/'
1211
1212
- if( (pystring::slice(path, 1, 2) != colon) ||
1213
- (pystring::slice(b, 1, 2) == colon) )
+
+ if ((path.size() >= 2 && path[1] != ':') || (b.size() >= 2 && b[1] == ':'))
1214
1215
// Path doesnt start with a drive letter
1216
b_nts = true;
0 commit comments