mirror of
https://github.com/reactos/ccache.git
synced 2024-12-02 16:46:24 +00:00
Implement is_absolute_path() helper function
This commit is contained in:
parent
d325739040
commit
82b7876473
1
ccache.h
1
ccache.h
@ -107,6 +107,7 @@ const char *get_home_directory(void);
|
||||
char *get_cwd();
|
||||
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);
|
||||
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);
|
||||
|
@ -90,7 +90,7 @@ char *find_executable(const char *name, const char *exclude_name)
|
||||
{
|
||||
char *path;
|
||||
|
||||
if (*name == '/') {
|
||||
if (is_absolute_path(name)) {
|
||||
return x_strdup(name);
|
||||
}
|
||||
|
||||
|
9
util.c
9
util.c
@ -938,6 +938,15 @@ char *get_relative_path(const char *from, const char *to)
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return whether path is absolute.
|
||||
*/
|
||||
int
|
||||
is_absolute_path(const char *path)
|
||||
{
|
||||
return path[0] == '/';
|
||||
}
|
||||
|
||||
/*
|
||||
* Update the modification time of a file in the cache to save it from LRU
|
||||
* cleanup.
|
||||
|
Loading…
Reference in New Issue
Block a user