summaryrefslogtreecommitdiff
path: root/include.c
diff options
context:
space:
mode:
Diffstat (limited to 'include.c')
-rw-r--r--include.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/include.c b/include.c
index b638011..2a4d659 100644
--- a/include.c
+++ b/include.c
@@ -273,12 +273,9 @@ find_full_inc_path(const char *file, const char *include, int type)
* in the directory of the file being parsed.
*/
if ((type == INCLUDEDOT) || (type == INCLUDENEXTDOT)) {
- const char *p;
+ const char *p = strrchr(file, '/');
- for (p = file + strlen(file); p > file; p--)
- if (*p == '/')
- break;
- if (p == file) {
+ if ((p == NULL) || (p == file)) {
strcpy(path, include);
}
else {