diff options
author | Berke Viktor <bviktor@hexchat.org> | 2013-05-04 18:21:48 +0200 |
---|---|---|
committer | Berke Viktor <bviktor@hexchat.org> | 2013-05-04 18:21:48 +0200 |
commit | fb01d4e9ab9739e11499538d85e8932fb97a2c57 (patch) | |
tree | 46d0d3e258b2c7b929dce76ab43723e2b79b3c0a /src/common/cfgfiles.c | |
parent | b2317d88007270f8b49d3282face90a7f2716e7d (diff) |
Replace g_strdup_printf with g_build_filename where possible
Diffstat (limited to 'src/common/cfgfiles.c')
-rw-r--r-- | src/common/cfgfiles.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/common/cfgfiles.c b/src/common/cfgfiles.c index 9e0146c4..76ed564f 100644 --- a/src/common/cfgfiles.c +++ b/src/common/cfgfiles.c @@ -112,7 +112,7 @@ list_loadconf (char *file, GSList ** list, char *defaultconf) int fd; struct stat st; - filebuf = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s", get_xdir (), file); + filebuf = g_build_filename (get_xdir (), file, NULL); fd = g_open (filebuf, O_RDONLY | OFLAGS, 0); g_free (filebuf); @@ -327,10 +327,10 @@ get_xdir (void) } else { - xdir = g_strdup_printf ("%s\\" "HexChat", out); + xdir = g_build_filename (out, "HexChat", NULL); } #else - xdir = g_strdup_printf ("%s/" HEXCHAT_DIR, g_get_user_config_dir ()); + xdir = g_build_filename (g_get_user_config_dir (), HEXCHAT_DIR, NULL); #endif } @@ -361,7 +361,7 @@ default_file (void) if (!dfile) { - dfile = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "hexchat.conf", get_xdir ()); + dfile = g_build_filename (get_xdir (), "hexchat.conf", NULL); } return dfile; } @@ -1179,7 +1179,7 @@ hexchat_open_file (char *file, int flags, int mode, int xof_flags) return g_open (file, flags | OFLAGS, 0); } - buf = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s", get_xdir (), file); + buf = g_build_filename (get_xdir (), file, NULL); if (xof_flags & XOF_DOMODE) { @@ -1204,7 +1204,7 @@ hexchat_fopen_file (const char *file, const char *mode, int xof_flags) if (xof_flags & XOF_FULLPATH) return fopen (file, mode); - buf = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s", get_xdir (), file); + buf = g_build_filename (get_xdir (), file, NULL); fh = g_fopen (buf, mode); g_free (buf); |