indent get_fname.c get_fname.h
This commit is contained in:
parent
81ff48ccbc
commit
967d37d8a7
2 changed files with 5 additions and 4 deletions
|
|
@ -33,7 +33,7 @@
|
|||
/* DIR_SAVE: Where is the user's saved directory?
|
||||
This is where their saved files are stored
|
||||
and where the "current_id.txt" file is saved.
|
||||
|
||||
|
||||
Windows predefines "savedir" as:
|
||||
"C:\Documents and Settings\%USERNAME%\Application Data\TuxPaint"
|
||||
though it may get overridden with "--savedir" option
|
||||
|
|
@ -60,10 +60,10 @@ const char *datadir;
|
|||
char *get_fname(const char *const name, int kind)
|
||||
{
|
||||
char f[512];
|
||||
const char *restrict const dir = (kind==DIR_SAVE) ? savedir : datadir;
|
||||
const char *restrict const dir = (kind == DIR_SAVE) ? savedir : datadir;
|
||||
|
||||
// Some mkdir()'s don't like trailing slashes
|
||||
snprintf(f, sizeof(f), "%s%c%s", dir, (*name)?'/':'\0', name);
|
||||
snprintf(f, sizeof(f), "%s%c%s", dir, (*name) ? '/' : '\0', name);
|
||||
|
||||
return strdup(f);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue