projects
/
yaz-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
17144b8
)
yaz_is_abspath: drive letter test NOT using isalpha
author
Adam Dickmeiss
<adam@indexdata.dk>
Mon, 25 Jul 2011 10:55:02 +0000
(12:55 +0200)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Mon, 25 Jul 2011 10:55:02 +0000
(12:55 +0200)
isalpha is problematic for signed chars and we assume drive letters are
[a-zA-Z] only; also isalpha depends locale.
src/tpath.c
patch
|
blob
|
history
diff --git
a/src/tpath.c
b/src/tpath.c
index
900552e
..
b802c98
100644
(file)
--- a/
src/tpath.c
+++ b/
src/tpath.c
@@
-129,7
+129,8
@@
int yaz_is_abspath(const char *p)
#ifdef WIN32
if (*p == '\\')
return 1;
- if (*p && p[1] == ':' && isalpha(*p))
+ if (*p && p[1] == ':' &&
+ ((*p >= 'A' && *p <= 'Z') || (*p >= 'a' && *p <= 'z')))
return 1;
#endif
return 0;