diff options
author | Nick Mathewson <nickm@torproject.org> | 2006-10-02 21:00:24 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2006-10-02 21:00:24 +0000 |
commit | d75edc35ccddac21717ec2862607b18b91330bd5 (patch) | |
tree | 4117830a25fd7799070139f9763ab77cf3cd1eed /src/common | |
parent | 36adc7cdd90f195013eb8e24a90ef40348787212 (diff) | |
download | tor-d75edc35ccddac21717ec2862607b18b91330bd5.tar.gz tor-d75edc35ccddac21717ec2862607b18b91330bd5.zip |
r8845@totoro: nickm | 2006-10-02 16:34:58 -0400
Fix an XXXX: make path_is_relative work on windows even though we never use it there.
svn:r8577
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/util.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/common/util.c b/src/common/util.c index bc732c9ed1..f7d27bb20a 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -1534,13 +1534,18 @@ tor_listdir(const char *dirname) return result; } -/** Return true iff <b>filename</b> is a relative path. (XXXX doesn't work on - * windows.) */ +/** Return true iff <b>filename</b> is a relative path. */ int path_is_relative(const char *filename) { if (filename && filename[0] == '/') return 0; +#ifdef MS_WINDOWS + else if (filename && filename[0] == '\\') + return 0; + else if (filename && strlen(filename)>3 && TOR_ISALPHA(filename[0]) && + filename[1] == ':' && filename[2] == '\\') +#endif else return 1; } |