diff options
Diffstat (limited to '')
-rw-r--r-- | open.c (renamed from openfile.c) | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -3,6 +3,24 @@ int +patheq(const char *have, const char *want, const char **end_out) +{ + while (*want) { + if (*have != *want) + return 0; + if (*have == '/') { + while (*++have == '/'); + while (*++want == '/'); + } + } + if (!end_out) + return !*have; + *end_out = have; + return 1; +} + + +int openfile(const char *path, int *is_new_fd_out, const char **fname_out) { const char *p; |