projects
/
feisty_meow.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
updated readme
[feisty_meow.git]
/
nucleus
/
library
/
filesystem
/
filename.cpp
diff --git
a/nucleus/library/filesystem/filename.cpp
b/nucleus/library/filesystem/filename.cpp
index 5ce3886e9affe0ec1a99cba71046403a778b41ff..ed7b914aa518d2d1b0c5fb017da2414456d94e22 100644
(file)
--- a/
nucleus/library/filesystem/filename.cpp
+++ b/
nucleus/library/filesystem/filename.cpp
@@
-190,13
+190,22
@@
void filename::canonicalize()
// on windows, we want to translate away from any cygwin or msys format into a more palatable
// version that the rest of windows understands.
// first, cygwin...
// on windows, we want to translate away from any cygwin or msys format into a more palatable
// version that the rest of windows understands.
// first, cygwin...
- const astring CYGDRIVE_PATH = astring(astring(DEFAULT_SEPARATOR, 1) + "cygdrive"
- + astring(DEFAULT_SEPARATOR, 1));
+//hmmm: make these into statics!
+ const astring CYGDRIVE_SENTINEL = "cygdrive";
+ const astring CYGDRIVE_PATH = astring(astring(DEFAULT_SEPARATOR, 1)
+ + CYGDRIVE_SENTINEL + astring(DEFAULT_SEPARATOR, 1));
+
// must be at least as long as the string we're looking for, plus a drive letter afterwards.
// must be at least as long as the string we're looking for, plus a drive letter afterwards.
- if ( (length() > CYGDRIVE_PATH.length() + 1) && begins(CYGDRIVE_PATH) ) {
+ if ( (length() >= CYGDRIVE_PATH.length() + 1)
+ && separator(get(0))
+ && separator(get(CYGDRIVE_PATH.length() - 1))
+ && compare(CYGDRIVE_SENTINEL, 1,
+ 0, CYGDRIVE_SENTINEL.length(), true) ) {
zap(0, CYGDRIVE_PATH.length() - 1); // whack the cygdrive portion plus two slashes.
insert(1, ":"); // add a colon after the imputed drive letter.
zap(0, CYGDRIVE_PATH.length() - 1); // whack the cygdrive portion plus two slashes.
insert(1, ":"); // add a colon after the imputed drive letter.
-//LOG(astring("turned cygdrive string into: ") + *this);
+//LOG(astring("turned cygdrive path string into: ") + *this);
+ } else {
+//LOG(astring("path didn't match so left as: ") + *this);
}
// now we convert msys...
if ( (length() >= 2) && (get(0) == DEFAULT_SEPARATOR)
}
// now we convert msys...
if ( (length() >= 2) && (get(0) == DEFAULT_SEPARATOR)