chiark
/
gitweb
/
~ian
/
userv.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Avoid accessing backup, auto-save files, etc, with include-lookup.
[userv.git]
/
parser.c
diff --git
a/parser.c
b/parser.c
index 5f6ebadc7da07b2f2efe6d09bbd7a1b1039b6c23..01b770e0bab9d15fa51a76642a7f5806ab9a1fe4 100644
(file)
--- a/
parser.c
+++ b/
parser.c
@@
-1089,8
+1089,14
@@
int df_includelookup(int dtoken) {
} else {
if (*p=='.') *q++= ':';
while ((c= *p++)) {
} else {
if (*p=='.') *q++= ':';
while ((c= *p++)) {
- if (c=='/') { *q++= ':'; c='-'; }
- else if (c==':') { *q++= ':'; }
+ if (c=='/') {
+ *q++= ':';
+ c= '-';
+ } else if (!((c >= '0' && c <= '9') ||
+ (c >= 'a' && c <= 'z') ||
+ c == '-' || c == '_')) {
+ *q++= ':';
+ }
*q++= c;
}
*q++= 0;
*q++= c;
}
*q++= 0;