File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2288,7 +2288,9 @@ static std::vector<std::string> SplitLogicapath(const char* lp) {
22882288 size_t pos = s.find (' :' , start);
22892289 if (pos == std::string::npos) pos = s.size ();
22902290 std::string part = s.substr (start, pos - start);
2291- if (!part.empty ()) roots.push_back (part);
2291+ // Preserve empty segments: in PATH-like variables (and in python's
2292+ // LOGICAPATH parsing), an empty entry means "current directory".
2293+ roots.push_back (part);
22922294 start = pos + 1 ;
22932295 }
22942296 return roots;
@@ -2413,7 +2415,8 @@ int main(int argc, char** argv) {
24132415 size_t pos = s.find (' :' , start);
24142416 if (pos == std::string::npos) pos = s.size ();
24152417 std::string part = s.substr (start, pos - start);
2416- if (!part.empty ()) import_root.push_back (part);
2418+ // Preserve empty segments (see SplitLogicapath).
2419+ import_root.push_back (part);
24172420 start = pos + 1 ;
24182421 }
24192422 }
Original file line number Diff line number Diff line change @@ -278,7 +278,7 @@ def _LogicapathFromImportRoot(import_root) -> Optional[str]:
278278 if isinstance (import_root , str ):
279279 return import_root
280280 if isinstance (import_root , (list , tuple )):
281- return ':' .join ([str (x ) for x in import_root if x ])
281+ return ':' .join ([str (x ) for x in import_root ])
282282 raise TypeError ('Unexpected import_root type: %r' % (type (import_root ),))
283283
284284
You can’t perform that action at this time.
0 commit comments