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?
|
/* DIR_SAVE: Where is the user's saved directory?
|
||||||
This is where their saved files are stored
|
This is where their saved files are stored
|
||||||
and where the "current_id.txt" file is saved.
|
and where the "current_id.txt" file is saved.
|
||||||
|
|
||||||
Windows predefines "savedir" as:
|
Windows predefines "savedir" as:
|
||||||
"C:\Documents and Settings\%USERNAME%\Application Data\TuxPaint"
|
"C:\Documents and Settings\%USERNAME%\Application Data\TuxPaint"
|
||||||
though it may get overridden with "--savedir" option
|
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 *get_fname(const char *const name, int kind)
|
||||||
{
|
{
|
||||||
char f[512];
|
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
|
// 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);
|
return strdup(f);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,8 @@
|
||||||
extern const char *savedir;
|
extern const char *savedir;
|
||||||
extern const char *datadir;
|
extern const char *datadir;
|
||||||
|
|
||||||
enum {
|
enum
|
||||||
|
{
|
||||||
DIR_SAVE,
|
DIR_SAVE,
|
||||||
DIR_DATA
|
DIR_DATA
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue