1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

STRING_DIR_SEP in config/*

This commit is contained in:
Witold Filipczyk 2006-07-02 08:53:33 +02:00 committed by Witold Filipczyk
parent d1e5e0b7d2
commit 7934d3c7d6
2 changed files with 5 additions and 5 deletions

View File

@ -500,13 +500,13 @@ load_config_file(unsigned char *prefix, unsigned char *name,
{ {
unsigned char *config_str, *config_file; unsigned char *config_str, *config_file;
config_file = straconcat(prefix, "/", name, NULL); config_file = straconcat(prefix, STRING_DIR_SEP, name, NULL);
if (!config_file) return 1; if (!config_file) return 1;
config_str = read_config_file(config_file); config_str = read_config_file(config_file);
if (!config_str) { if (!config_str) {
mem_free(config_file); mem_free(config_file);
config_file = straconcat(prefix, "/.", name, NULL); config_file = straconcat(prefix, STRING_DIR_SEP, ".", name, NULL);
if (!config_file) return 2; if (!config_file) return 2;
config_str = read_config_file(config_file); config_str = read_config_file(config_file);
@ -796,7 +796,7 @@ write_config_file(unsigned char *prefix, unsigned char *name,
int prefixlen = strlen(prefix); int prefixlen = strlen(prefix);
int prefix_has_slash = (prefixlen && dir_sep(prefix[prefixlen - 1])); int prefix_has_slash = (prefixlen && dir_sep(prefix[prefixlen - 1]));
int name_has_slash = dir_sep(name[0]); int name_has_slash = dir_sep(name[0]);
unsigned char *slash = name_has_slash || prefix_has_slash ? "" : "/"; unsigned char *slash = name_has_slash || prefix_has_slash ? "" : STRING_DIR_SEP;
if (!cfg_str) return -1; if (!cfg_str) return -1;

View File

@ -49,7 +49,7 @@ test_confdir(unsigned char *home, unsigned char *path,
if (!path || !*path) return NULL; if (!path || !*path) return NULL;
if (home && *home && !dir_sep(*path)) if (home && *home && !dir_sep(*path))
confdir = straconcat(home, "/", path, NULL); confdir = straconcat(home, STRING_DIR_SEP, path, NULL);
else else
confdir = stracpy(path); confdir = stracpy(path);
@ -134,7 +134,7 @@ get_home(void)
end: end:
if (home_elinks) if (home_elinks)
add_to_strn(&home_elinks, "/"); add_to_strn(&home_elinks, STRING_DIR_SEP);
mem_free_if(home); mem_free_if(home);
return home_elinks; return home_elinks;