summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-04-10 02:53:06 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-04-10 02:53:06 +0000
commitbd00ff54c2bf569de50ff2df433bf90f279321a3 (patch)
tree3b3fcba93d018c7264ef5961842c410fcf0b10c9 /src/core
parentec168a40096427e381c00e0ea04360d71abcf4d6 (diff)
downloadirssi-bd00ff54c2bf569de50ff2df433bf90f279321a3.zip
Fixed one error and several warnings with GLIB 2.0
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2663 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core')
-rw-r--r--src/core/servers.c14
-rw-r--r--src/core/session.c7
-rw-r--r--src/core/special-vars.c4
3 files changed, 14 insertions, 11 deletions
diff --git a/src/core/servers.c b/src/core/servers.c
index f99b238f..1e5c0b84 100644
--- a/src/core/servers.c
+++ b/src/core/servers.c
@@ -257,6 +257,8 @@ static void server_connect_callback_readpipe(SERVER_REC *server)
/* initializes server record but doesn't start connecting */
void server_connect_init(SERVER_REC *server)
{
+ const char *str;
+
g_return_if_fail(server != NULL);
MODULE_DATA_INIT(server);
@@ -267,16 +269,16 @@ void server_connect_init(SERVER_REC *server)
if (server->connrec->username == NULL || *server->connrec->username == '\0') {
g_free_not_null(server->connrec->username);
- server->connrec->username = g_get_user_name();
- if (*server->connrec->username == '\0') server->connrec->username = "-";
- server->connrec->username = g_strdup(server->connrec->username);
+ str = g_get_user_name();
+ if (*str == '\0') str = "-";
+ server->connrec->username = g_strdup(str);
}
if (server->connrec->realname == NULL || *server->connrec->realname == '\0') {
g_free_not_null(server->connrec->realname);
- server->connrec->realname = g_get_real_name();
- if (*server->connrec->realname == '\0') server->connrec->realname = "-";
- server->connrec->realname = g_strdup(server->connrec->realname);
+ str = g_get_real_name();
+ if (*str == '\0') str = "-";
+ server->connrec->realname = g_strdup(str);
}
server->tag = server_create_tag(server->connrec);
diff --git a/src/core/session.c b/src/core/session.c
index 7e7b0afa..b5419134 100644
--- a/src/core/session.c
+++ b/src/core/session.c
@@ -39,6 +39,7 @@ static char **session_args;
void session_set_binary(const char *path)
{
+ const char *envpath;
char **paths, **tmp;
char *str;
@@ -59,10 +60,10 @@ void session_set_binary(const char *path)
}
/* we'll need to find it from path. */
- str = g_getenv("PATH");
- if (str == NULL) return;
+ envpath = g_getenv("PATH");
+ if (envpath == NULL) return;
- paths = g_strsplit(str, ":", -1);
+ paths = g_strsplit(envpath, ":", -1);
for (tmp = paths; *tmp != NULL; tmp++) {
str = g_strconcat(*tmp, G_DIR_SEPARATOR_S, path, NULL);
if (access(str, X_OK) == 0) {
diff --git a/src/core/special-vars.c b/src/core/special-vars.c
index 2556cd63..7291f469 100644
--- a/src/core/special-vars.c
+++ b/src/core/special-vars.c
@@ -106,7 +106,7 @@ static char *get_long_variable_value(const char *key, SERVER_REC *server,
void *item, int *free_ret)
{
EXPANDO_FUNC func;
- char *ret;
+ const char *ret;
int type;
*free_ret = FALSE;
@@ -124,7 +124,7 @@ static char *get_long_variable_value(const char *key, SERVER_REC *server,
/* environment variable? */
ret = g_getenv(key);
if (ret != NULL)
- return ret;
+ return (char *) ret;
return NULL;
}