if (comp.count) {
comp.text = g_strdup_printf("%s%d%s", comp.prefix, comp.count, value);
} else {
- comp.text = g_strdup_printf("%s%s", comp.prefix, value);
+ comp.text = g_strconcat(comp.prefix, value, NULL);
}
/* print the text also into inputbox */
vb_set_input_text(comp.text);
if (vb.mode->flags & FLAG_HINTING) {
vb.mode->flags &= ~FLAG_HINTING;
vb_set_input_text("");
- js = g_strdup_printf("%s.clear();", HINT_VAR);
+ js = g_strconcat(HINT_VAR, ".clear();", NULL);
vb_eval_script(webkit_web_view_get_main_frame(vb.gui.webview), js, HINT_FILE, &value);
g_free(value);
g_free(js);
void hints_fire(void)
{
- char *js = g_strdup_printf("%s.fire();", HINT_VAR);
+ char *js = g_strconcat(HINT_VAR, ".fire();", NULL);
run_script(js);
g_free(js);
}
path = vb.config.home_page;
}
- if (g_strrstr(path, "://") || !strncmp(path, "about:", 6)) {
+ if (strstr(path, "://") || !strncmp(path, "about:", 6)) {
uri = g_strdup(path);
} else if (stat(path, &st) == 0) {
/* check if the path is a file path */
rp = realpath(path, NULL);
- uri = g_strdup_printf("file://%s", rp);
+ uri = g_strconcat("file://", rp, NULL);
free(rp);
} else if (strchr(path, ' ') || !strchr(path, '.')) {
/* use a shortcut if path contains spaces or no dot */
}
if (!uri) {
- uri = g_strdup_printf("http://%s", path);
+ uri = g_strconcat("http://", path, NULL);
}
if (arg->i == VB_TARGET_NEW) {
{
char *message;
if (link) {
- message = g_strdup_printf("Link: %s", link);
+ message = g_strconcat("Link: ", link, NULL);
gtk_label_set_text(GTK_LABEL(vb.gui.statusbar.left), message);
g_free(message);
} else {
if (enabled) {
proxy = (char *)g_getenv("http_proxy");
if (proxy != NULL && strlen(proxy)) {
- proxy_new = g_strrstr(proxy, "http://")
+ proxy_new = g_str_has_prefix(proxy, "http://")
? g_strdup(proxy)
- : g_strdup_printf("http://%s", proxy);
+ : g_strconcat("http://", proxy, NULL);
proxy_uri = soup_uri_new(proxy_new);
g_object_set(vb.session, "proxy-uri", proxy_uri, NULL);