File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
xivModdingFramework/Helpers Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -744,6 +744,11 @@ public static void CopyFolder(string sourcePath, string targetPath)
744
744
sourcePath = MakeLongPath ( sourcePath ) ;
745
745
targetPath = MakeLongPath ( targetPath ) ;
746
746
747
+ // \\?\ prefixed Long File Names will fail if there's double slashes in a path
748
+ // Guarantee the source and target both have trailing slashes to avoid accidentally creating a double slash
749
+ if ( ! sourcePath . EndsWith ( "\\ " ) ) sourcePath += "\\ " ;
750
+ if ( ! targetPath . EndsWith ( "\\ " ) ) targetPath += "\\ " ;
751
+
747
752
Directory . CreateDirectory ( targetPath ) ;
748
753
749
754
//Now Create all of the directories
@@ -765,6 +770,8 @@ public static string MakeLongPath(string path)
765
770
{
766
771
if ( ! path . StartsWith ( "\\ \\ ?\\ " ) )
767
772
{
773
+ while ( path . Contains ( "\\ \\ " ) )
774
+ path = path . Replace ( "\\ \\ " , "\\ " ) ;
768
775
path = "\\ \\ ?\\ " + path ;
769
776
}
770
777
return path . Replace ( "/" , "\\ " ) ;
You can’t perform that action at this time.
0 commit comments