summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-10-19 11:18:54 -0400
committerpommicket <pommicket@gmail.com>2023-10-19 11:18:54 -0400
commit553f01db25db52eea5396b575c66e2a6e77db1ce (patch)
tree75e7452c311719bbd9f022d8c549052db82ebce3 /config.c
parent94c2b5a926cd7273272fb9fe268dd61c50426c59 (diff)
is_path_separator
Diffstat (limited to 'config.c')
-rw-r--r--config.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/config.c b/config.c
index 1da3dec..97496ca 100644
--- a/config.c
+++ b/config.c
@@ -558,7 +558,7 @@ static void get_config_path(Ted *ted, char *expanded, size_t expanded_sz, const
assert(path != expanded);
expanded[0] = '\0';
- if (path[0] == '~' && strchr(ALL_PATH_SEPARATORS, path[1])) {
+ if (path[0] == '~' && is_path_separator(path[1])) {
str_printf(expanded, expanded_sz, "%s%c%s", ted->home, PATH_SEPARATOR, path + 1);
} else if (!path_is_absolute(path)) {
if (!ted_get_file(ted, path, expanded, expanded_sz)) {
@@ -1278,7 +1278,7 @@ static char *editorconfig_glob_to_regex(ConfigReader *reader, const char *glob)
assert(0);
goto error;
}
- if (!strchr(ALL_PATH_SEPARATORS, dirname[strlen(dirname) - 1])) {
+ if (!is_path_separator(dirname[strlen(dirname) - 1])) {
strbuf_catf(dirname, "%c", PATH_SEPARATOR);
}
for (const char *p = dirname; *p; ++p)
@@ -1563,7 +1563,7 @@ void config_read(Ted *ted, const char *path, ConfigFormat format) {
static char *last_separator(char *path) {
for (int i = (int)strlen(path) - 1; i >= 0; --i)
- if (strchr(ALL_PATH_SEPARATORS, path[i]))
+ if (is_path_separator(path[i]))
return &path[i];
return NULL;
}