projects
/
browser-switch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix off-by-one error in launch_other_browser
[browser-switch]
/
launcher.c
diff --git
a/launcher.c
b/launcher.c
index
5a6b951
..
24dff0a
100644
(file)
--- a/
launcher.c
+++ b/
launcher.c
@@
-46,9
+46,7
@@
static void launch_tear(struct swb_context *ctx, char *uri) {
printf("launch_tear with uri '%s'\n", uri);
status = system("pidof tear > /dev/null");
printf("launch_tear with uri '%s'\n", uri);
status = system("pidof tear > /dev/null");
- if (!WIFEXITED(status))
- exit(1);
- if (!WEXITSTATUS(status)) {
+ if (WIFEXITED(status) && !WEXITSTATUS(status)) {
if (!tear_proxy)
tear_proxy = dbus_g_proxy_new_for_name(ctx->session_bus,
"com.nokia.tear", "/com/nokia/tear",
if (!tear_proxy)
tear_proxy = dbus_g_proxy_new_for_name(ctx->session_bus,
"com.nokia.tear", "/com/nokia/tear",
@@
-80,9
+78,7
@@
void launch_microb(struct swb_context *ctx, char *uri) {
uri = "new_window";
status = system("pidof /usr/sbin/browserd > /dev/null");
uri = "new_window";
status = system("pidof /usr/sbin/browserd > /dev/null");
- if (!WIFEXITED(status))
- exit(1);
- if (WEXITSTATUS(status)) {
+ if (WIFEXITED(status) && WEXITSTATUS(status)) {
kill_browserd = 1;
system("/usr/sbin/browserd -d");
}
kill_browserd = 1;
system("/usr/sbin/browserd -d");
}
@@
-158,7
+154,7
@@
static void launch_other_browser(struct swb_context *ctx, char *uri) {
/* Move the string after the ', including the \0,
over two chars */
/* Move the string after the ', including the \0,
over two chars */
- memmove(quote+3, quote+1, strlen(quote)+1);
+ memmove(quote+3, quote+1, strlen(quote));
memcpy(quote, "%27", 3);
quote = quote + 3;
}
memcpy(quote, "%27", 3);
quote = quote + 3;
}