浏览代码

Bug fix: Browsing long paths was broken by 9a54ec5f (Using large fetch and not reading short names when reading directories for file panel)

Would add \\? prefix to tree and drive combobox

Source commit: 7b862e177adf09600a200921dec1d4f1e055b049
Martin Prikryl 1 年之前
父节点
当前提交
5635eeddf0
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      source/packages/filemng/DirView.pas

+ 6 - 0
source/packages/filemng/DirView.pas

@@ -811,6 +811,8 @@ begin
 end;
 
 procedure TDirView.SetPath(Value: string);
+const
+  LongPathPrefix = '\\?\';
 var
   LongPath: string;
   Len: Integer;
@@ -831,7 +833,11 @@ begin
     SetLength(LongPath, Len);
     Len := GetLongPathName(PChar(ApiPath(Value)), PChar(LongPath), Len);
     if Len > 0 then
+    begin
       Value := Copy(LongPath, 1, Len);
+      if StartsStr(LongPathPrefix, Value) then
+        System.Delete(Value, 1, Length(LongPathPrefix));
+    end;
   end;
 
   CheckCanOpenDirectory(Value);