Improvements to path handling. Patch from bit.
This commit is contained in:
parent
1d4c9ab4e8
commit
807b710a5d
55 changed files with 588 additions and 368 deletions
14
src/config.c
14
src/config.c
|
|
@ -190,8 +190,6 @@ void config_load(int is_global, char *fn)
|
|||
}
|
||||
|
||||
fclose(f);
|
||||
|
||||
config_dump(is_global);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -353,6 +351,18 @@ void append_filename(char *dest, char *s1, char *s2, int size)
|
|||
sprintf(dest, "%s%s", s1, s2);
|
||||
}
|
||||
|
||||
void append_slash(char *s, int size)
|
||||
{
|
||||
int c = strlen(s)-1;
|
||||
if (s[c] != '/' && s[c] != '\\')
|
||||
{
|
||||
if (c < size-2)
|
||||
strcat(s, "/");
|
||||
else
|
||||
s[c] = '/';
|
||||
}
|
||||
}
|
||||
|
||||
void put_backslash(char *s)
|
||||
{
|
||||
int c = strlen(s) - 1;
|
||||
|
|
|
|||
Loading…
Reference in a new issue