diff options
author | Christopher Faylor <me@cgf.cx> | 2001-08-15 03:24:18 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2001-08-15 03:24:18 +0000 |
commit | da3ea61edda86f0f1c3176b5b1ee30265c5ec1a3 (patch) | |
tree | 1503e59621985b1720fff196851c537d923d5e08 /winsup/utils/cygpath.cc | |
parent | 3ca6bcc4d0b3e32ebbd7ec6956abb3240e558c75 (diff) | |
download | cygnal-da3ea61edda86f0f1c3176b5b1ee30265c5ec1a3.tar.gz cygnal-da3ea61edda86f0f1c3176b5b1ee30265c5ec1a3.tar.bz2 cygnal-da3ea61edda86f0f1c3176b5b1ee30265c5ec1a3.zip |
* cygpath.cc (main): Support -w for Windows (System) directories and return
physical correct orthography for the Windows System dir.
Diffstat (limited to 'winsup/utils/cygpath.cc')
-rw-r--r-- | winsup/utils/cygpath.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/winsup/utils/cygpath.cc b/winsup/utils/cygpath.cc index 8e2aa1d89..afe90ea7f 100644 --- a/winsup/utils/cygpath.cc +++ b/winsup/utils/cygpath.cc @@ -208,6 +208,7 @@ main (int argc, char **argv) int options_from_file_flag; char *filename; char buf[MAX_PATH], buf2[MAX_PATH]; + WIN32_FIND_DATA w32_fd; prog_name = strrchr (argv[0], '/'); if (prog_name == NULL) @@ -266,13 +267,21 @@ main (int argc, char **argv) case 'W': GetWindowsDirectory(buf, MAX_PATH); - cygwin_conv_to_posix_path(buf, buf2); + if (!windows_flag) + cygwin_conv_to_posix_path(buf, buf2); + else + strcpy(buf2, buf); printf("%s\n", buf2); exit(0); case 'S': GetSystemDirectory(buf, MAX_PATH); - cygwin_conv_to_posix_path(buf, buf2); + FindFirstFile(buf, &w32_fd); + strcpy(strrchr(buf, '\\')+1, w32_fd.cFileName); + if (!windows_flag) + cygwin_conv_to_posix_path(buf, buf2); + else + strcpy(buf2, buf); printf("%s\n", buf2); exit(0); |