File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
SQLite.CodeFirst/Internal/Utility Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 22using System . Collections . Generic ;
33using System . Diagnostics . CodeAnalysis ;
44using System . Globalization ;
5+ using System . IO ;
56
67namespace SQLite . CodeFirst . Utility
78{
@@ -64,14 +65,14 @@ private static string ExpandDataDirectory(string path)
6465
6566 // We don't know if rootFolderpath ends with '\', and we don't know if the given name starts with onw
6667 int fileNamePosition = DataDirectoryToken . Length ; // filename starts right after the '|datadirectory|' keyword
67- bool rootFolderEndsWith = ( 0 < rootFolderPath . Length ) && rootFolderPath [ rootFolderPath . Length - 1 ] == ' \\ ' ;
68- bool fileNameStartsWith = ( fileNamePosition < path . Length ) && path [ fileNamePosition ] == ' \\ ' ;
68+ bool rootFolderEndsWith = ( 0 < rootFolderPath . Length ) && rootFolderPath [ rootFolderPath . Length - 1 ] == Path . DirectorySeparatorChar ;
69+ bool fileNameStartsWith = ( fileNamePosition < path . Length ) && path [ fileNamePosition ] == Path . DirectorySeparatorChar ;
6970
7071 // replace |datadirectory| with root folder path
7172 if ( ! rootFolderEndsWith && ! fileNameStartsWith )
7273 {
7374 // need to insert '\'
74- fullPath = rootFolderPath + ' \\ ' + path . Substring ( fileNamePosition ) ;
75+ fullPath = rootFolderPath + Path . DirectorySeparatorChar + path . Substring ( fileNamePosition ) ;
7576 }
7677 else if ( rootFolderEndsWith && fileNameStartsWith )
7778 {
You can’t perform that action at this time.
0 commit comments