if (compare_executable_name(base, MYNAME)) {
args_remove_first(orig_args);
free(base);
- if (strchr(argv[1],'/')) {
+ if (is_full_path(argv[1])) {
/* a full path was given */
return;
}
size_t common_dir_prefix_length(const char *s1, const char *s2);
char *get_relative_path(const char *from, const char *to);
int is_absolute_path(const char *path);
+int is_full_path(const char *path);
void update_mtime(const char *path);
void *x_fmmap(const char *fname, off_t *size, const char *errstr);
int x_munmap(void *addr, size_t length);
return path[0] == '/';
}
+/*
+ * Return whether the argument is a full path.
+ */
+int
+is_full_path(const char *path)
+{
+ if (strchr(path, '/'))
+ return 1;
+ return 0;
+}
+
/*
* Update the modification time of a file in the cache to save it from LRU
* cleanup.