1 --- sal/osl/w32/file_url.h
2 +++ sal/osl/w32/file_url.h
4 #define VALIDATEPATH_ALLOW_ELLIPSE 0x0002
5 #define VALIDATEPATH_ALLOW_RELATIVE 0x0004
6 #define VALIDATEPATH_ALLOW_UNC 0x0008
7 +#define VALIDATEPATH_ALLOW_INVALID_SPACE_AND_PERIOD 0x0010
9 DWORD IsValidFilePath (
11 --- sal/osl/w32/file_url.cxx
12 +++ sal/osl/w32/file_url.cxx
13 @@ -1108,9 +1109,10 @@
15 if ( dwFlags & VALIDATEPATH_ALLOW_ELLIPSE )
17 - if ( 1 == lpCurrent - lpComponent )
18 + if ( (dwFlags & VALIDATEPATH_ALLOW_INVALID_SPACE_AND_PERIOD) ||
19 + 1 == lpCurrent - lpComponent )
21 - /* Current directory is O.K. */
22 + /* Either do allow periods anywhere, or current directory */
23 lpComponentEnd = lpCurrent;
26 @@ -1123,8 +1125,13 @@ namespace /* private */
30 - lpComponentEnd = lpCurrent - 1;
32 + if ( dwFlags & VALIDATEPATH_ALLOW_INVALID_SPACE_AND_PERIOD )
33 + lpComponentEnd = lpCurrent;
36 + lpComponentEnd = lpCurrent - 1;
41 lpComponentEnd = lpCurrent;
42 @@ -1365,7 +1372,7 @@ namespace /* private */
43 lpComponent = lpszPath + i;
46 - fValid = IsValidFilePathComponent( lpComponent, &lpComponent, dwFlags );
47 + fValid = IsValidFilePathComponent( lpComponent, &lpComponent, dwFlags | VALIDATEPATH_ALLOW_INVALID_SPACE_AND_PERIOD);
49 if ( fValid && lpComponent )