[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r8577: Fix an XXXX: make path_is_relative work on windows even thou (in tor/trunk: . src/common)



Author: nickm
Date: 2006-10-02 17:00:24 -0400 (Mon, 02 Oct 2006)
New Revision: 8577

Modified:
   tor/trunk/
   tor/trunk/src/common/util.c
Log:
 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.



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r8845] on 96637b51-b116-0410-a10e-9941ebb49b64

Modified: tor/trunk/src/common/util.c
===================================================================
--- tor/trunk/src/common/util.c	2006-10-02 21:00:20 UTC (rev 8576)
+++ tor/trunk/src/common/util.c	2006-10-02 21:00:24 UTC (rev 8577)
@@ -1534,13 +1534,18 @@
   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;
 }