Created
June 25, 2019 16:43
-
-
Save rfht/584be90adb030de726b6737ec77e3063 to your computer and use it in GitHub Desktop.
Path.GetFullPath() bug demo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.IO; | |
| class GetFullPathBugDemo | |
| { | |
| public static void Main(string[] args) | |
| { | |
| Console.WriteLine("Test with rooted path:"); | |
| Console.WriteLine(Path.GetFullPath(Directory.GetCurrentDirectory() + @"/test//test//test//")); | |
| Console.WriteLine("Test with relative path:"); | |
| Console.WriteLine(Path.GetFullPath(@"test//test//test//")); | |
| } | |
| } |
Author
Author
On OpenBSD:
thfr@ryz.domain:tmp$ mono --version
Mono JIT compiler version 5.20.1.19 (tarball Mon Jun 24 09:30:38 MDT 2019)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS:
SIGSEGV: normal
Notification: kqueue
Architecture: amd64
Disabled: none
Misc: softdebug
Interpreter: yes
LLVM: supported, not enabled.
Suspend: cooperative
GC: sgen (concurrent by default)
thfr@ryz.domain:tmp$ mono ~/obsd/ports/mono/GetFullPathBugDemo.exe
Test with rooted path:
/tmp/test/test/test/
Test with relative path:
/tmp/test//test//test//
thfr@ryz.domain:tmp$
Author
On Ubuntu:
thfr@thfr-MS-7B79:/tmp$ mono --version
Mono JIT compiler version 5.20.1.19 (tarball Thu Apr 11 09:02:17 UTC 2019)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
Interpreter: yes
LLVM: yes(600)
Suspend: hybrid
GC: sgen (concurrent by default)
thfr@thfr-MS-7B79:/tmp$ mono GetFullPathBugDemo.exe
Test with rooted path:
/tmp/test/test/test/
Test with relative path:
/tmp/test//test//test//
thfr@thfr-MS-7B79:/tmp$
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
On Windows 10: