diff options
author | Arnavion <arnavion@gmail.com> | 2014-12-08 21:24:59 -0800 |
---|---|---|
committer | Arnavion <arnavion@gmail.com> | 2014-12-08 21:24:59 -0800 |
commit | c1831cb19dc1a95bfe96c808aaf5ee42f7401995 (patch) | |
tree | 51186833204b4061ead7794b17e8f43d32e03596 /src/common | |
parent | 65da34f19eab5edde0615ccc4a58be1947cfce6e (diff) |
Minor tidying up
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/cfgfiles.c | 4 | ||||
-rw-r--r-- | src/common/text.c | 15 | ||||
-rw-r--r-- | src/common/url.c | 12 |
3 files changed, 11 insertions, 20 deletions
diff --git a/src/common/cfgfiles.c b/src/common/cfgfiles.c index 020e3bc1..069ca70b 100644 --- a/src/common/cfgfiles.c +++ b/src/common/cfgfiles.c @@ -308,9 +308,7 @@ get_xdir (void) if (portable_mode () || SHGetKnownFolderPath (&FOLDERID_RoamingAppData, 0, NULL, &roaming_path_wide) != S_OK) { - char *path; - - path = g_win32_get_package_installation_directory_of_module (NULL); + char *path = g_win32_get_package_installation_directory_of_module (NULL); if (path) { xdir = g_build_filename (path, "config", NULL); diff --git a/src/common/text.c b/src/common/text.c index 6a6b65e7..5af98073 100644 --- a/src/common/text.c +++ b/src/common/text.c @@ -393,9 +393,7 @@ log_close (session *sess) static void mkdir_p (char *filename) { - char *dirname; - - dirname = g_path_get_dirname (filename); + char *dirname = g_path_get_dirname (filename); g_mkdir_with_parents (dirname, 0700); @@ -582,7 +580,7 @@ log_create_pathname (char *servname, char *channame, char *netname) /* create all the subdirectories */ mkdir_p (fname); - return g_strdup(fname); + return g_strdup (fname); } static int @@ -711,15 +709,13 @@ log_write (session *sess, char *text, time_t ts) log_open (sess); /* change to a different log file? */ - file = log_create_pathname (sess->server->servername, sess->channel, - server_get_network (sess->server, FALSE)); + file = log_create_pathname (sess->server->servername, sess->channel, server_get_network (sess->server, FALSE)); if (file) { if (g_access (file, F_OK) != 0) { close (sess->logfd); - sess->logfd = log_open_file (sess->server->servername, sess->channel, - server_get_network (sess->server, FALSE)); + sess->logfd = log_open_file (sess->server->servername, sess->channel, server_get_network (sess->server, FALSE)); } g_free (file); } @@ -905,7 +901,8 @@ PrintTextTimeStamp (session *sess, char *text, time_t timestamp) { text = "\n"; conv = NULL; - } else + } + else { int len = -1; conv = text_validate ((char **)&text, &len); diff --git a/src/common/url.c b/src/common/url.c index 5fbeb6c8..732449a4 100644 --- a/src/common/url.c +++ b/src/common/url.c @@ -587,18 +587,14 @@ re_url (void) if (uri[i].flags & URI_PATH) { - char *sep_escaped; - - sep_escaped = g_regex_escape_string (uri[i].path_sep, - strlen(uri[i].path_sep)); + char *sep_escaped = g_regex_escape_string (uri[i].path_sep, strlen(uri[i].path_sep)); - g_string_append_printf(grist_gstr, "(" "%s" PATH ")?", - sep_escaped); + g_string_append_printf (grist_gstr, "(" "%s" PATH ")?", sep_escaped); - g_free(sep_escaped); + g_free (sep_escaped); } - g_string_append(grist_gstr, ")"); + g_string_append (grist_gstr, ")"); } grist = g_string_free (grist_gstr, FALSE); |