File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -239,12 +239,20 @@ class path {
239239 tmp.erase (0 , LONG_PATH_PREFIX.length ());
240240 }
241241
242- // Special-case handling of absolute SMB paths, which start with the prefix "\\"
242+ // Special-case handling of absolute SMB paths, which start with the prefix "\\".
243243 if (tmp.length () >= 2 && tmp[0 ] == ' \\ ' && tmp[1 ] == ' \\ ' ) {
244244 m_path = {};
245245 tmp.erase (0 , 2 );
246- m_absolute = true ;
247- m_smb = true ;
246+
247+ // Interestingly, there is a special-special case where relative paths may be specified as beginning with a "\\"
248+ // when a non-SMB file with a more-than-260-characters-long absolute _local_ path is double-clicked. This seems to
249+ // only happen with single-segment relative paths, so we can check for this condition by making sure no further
250+ // path separators are present.
251+ if (tmp.find_first_of (" /\\ " ) != std::string::npos)
252+ m_absolute = m_smb = true ;
253+ else
254+ m_absolute = m_smb = false ;
255+
248256 // Special-case handling of absolute SMB paths, which start with the prefix "UNC\"
249257 } else if (tmp.length () >= 4 && tmp[0 ] == ' U' && tmp[1 ] == ' N' && tmp[2 ] == ' C' && tmp[3 ] == ' \\ ' ) {
250258 m_path = {};
You can’t perform that action at this time.
0 commit comments