mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-27 22:03:31 +01:00
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
This commit is contained in:
parent
36adc7cdd9
commit
d75edc35cc
@ -1534,13 +1534,18 @@ tor_listdir(const char *dirname)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Return true iff <b>filename</b> is a relative path. (XXXX doesn't work on
|
/** Return true iff <b>filename</b> is a relative path. */
|
||||||
* windows.) */
|
|
||||||
int
|
int
|
||||||
path_is_relative(const char *filename)
|
path_is_relative(const char *filename)
|
||||||
{
|
{
|
||||||
if (filename && filename[0] == '/')
|
if (filename && filename[0] == '/')
|
||||||
return 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
|
else
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user