diff options
author | Nick Mathewson <nickm@torproject.org> | 2010-02-22 12:42:31 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2010-02-22 12:42:31 -0500 |
commit | d35b8dc5827762cd9cbee90f57ef370f477539fb (patch) | |
tree | d2159aa694d4fde110ae43b21ed1bd5e97fc32db /src/common | |
parent | 1dfbec482c50dabd2359d74848a13cbc03c4f9ea (diff) | |
download | tor-d35b8dc5827762cd9cbee90f57ef370f477539fb.tar.gz tor-d35b8dc5827762cd9cbee90f57ef370f477539fb.zip |
Make expand_filename into a tor_strdup() alias on windows.
On Windows, we don't have a notion of ~ meaning "our homedir", so we
were deliberately using an #ifdef to avoid calling expand_filename()
in multiple places. This is silly: The right place to turn a function
into a no-op on a single platform is in the function itself, not in
every single call-site.
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/util.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/common/util.c b/src/common/util.c index a15af7ed57..f7e5dd06c5 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -2312,6 +2312,9 @@ char * expand_filename(const char *filename) { tor_assert(filename); +#ifdef MS_WINDOWS + return tor_strdup(filename); +#else if (*filename == '~') { size_t len; char *home, *result; @@ -2361,6 +2364,7 @@ expand_filename(const char *filename) } else { return tor_strdup(filename); } +#endif } #define MAX_SCANF_WIDTH 9999 |