basic/path-util: inline two trivial functions
While at it, add assert() for the argument.
This commit is contained in:
parent
f7bc0c324a
commit
cd4ff5aa11
|
@ -28,14 +28,6 @@
|
|||
#include "time-util.h"
|
||||
#include "utf8.h"
|
||||
|
||||
bool path_is_absolute(const char *p) {
|
||||
return p[0] == '/';
|
||||
}
|
||||
|
||||
bool is_path(const char *p) {
|
||||
return !!strchr(p, '/');
|
||||
}
|
||||
|
||||
int path_split_and_make_absolute(const char *p, char ***ret) {
|
||||
char **l;
|
||||
int r;
|
||||
|
|
|
@ -42,9 +42,17 @@
|
|||
# define DEFAULT_USER_PATH DEFAULT_PATH
|
||||
#endif
|
||||
|
||||
bool is_path(const char *p) _pure_;
|
||||
static inline bool is_path(const char *p) {
|
||||
assert(p);
|
||||
return strchr(p, '/');
|
||||
}
|
||||
|
||||
static inline bool path_is_absolute(const char *p) {
|
||||
assert(p);
|
||||
return p[0] == '/';
|
||||
}
|
||||
|
||||
int path_split_and_make_absolute(const char *p, char ***ret);
|
||||
bool path_is_absolute(const char *p) _pure_;
|
||||
char* path_make_absolute(const char *p, const char *prefix);
|
||||
int safe_getcwd(char **ret);
|
||||
int path_make_absolute_cwd(const char *p, char **ret);
|
||||
|
|
Loading…
Reference in New Issue