commit b9ab118cfdc2e3c210633d34e564573379aca419
parent 2ffb4286d0e2816f29393ce64b025eaff02726b0
Author: Kyle Milz <kmilz@ucalgary.ca>
Date: Wed, 19 Sep 2012 19:13:13 -0600
commands: remove some uses of g_ functions
Diffstat:
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/commands.c b/commands.c
@@ -446,7 +446,7 @@ number(const Arg *arg, void *data)
if (!source)
return TRUE;
- uri = g_strdup(source); /* copy string */
+ uri = strdup(source); /* copy string */
p =& uri[0];
while(*p != '\0') /* goto the end of the string */
++p;
@@ -519,7 +519,7 @@ open_arg(const Arg *arg, void *data)
}
if (!new) {
if (len > 3 && strstr(s, "://")) { /* valid url? */
- p = new = g_malloc(len + 1);
+ p = new = malloc(len + 1);
while(*s != '\0') { /* strip whitespaces */
if (*s != ' ')
*(p++) = *s;
@@ -527,18 +527,18 @@ open_arg(const Arg *arg, void *data)
}
*p = '\0';
} else if (strcspn(s, "/") == 0 || strcspn(s, "./") == 0) { /* prepend "file://" */
- new = g_malloc(sizeof("file://") + len);
+ new = malloc(sizeof("file://") + len);
strcpy(new, "file://");
memcpy(&new[sizeof("file://") - 1], s, len + 1);
} else if (p || !strchr(s, '.')) { /* whitespaces or no dot? */
search_uri = find_uri_for_searchengine(defaultsearch);
if (search_uri != NULL) {
search_term = soup_uri_encode(s, "&");
- new = g_strdup_printf(search_uri, search_term);
- g_free(search_term);
+ new = strdup_printf(search_uri, search_term);
+ free(search_term);
}
} else { /* prepend "http://" */
- new = g_malloc(sizeof("http://") + len);
+ new = malloc(sizeof("http://") + len);
strcpy(new, "http://");
memcpy(&new[sizeof("http://") - 1], s, len + 1);
}