comparison src/browser.c @ 3417:68fdee3dd3ef

[gaim-migrate @ 3436] That was so broken. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Thu, 22 Aug 2002 03:13:39 +0000
parents 2a34734f6a0d
children 0d1af9166119
comparison
equal deleted inserted replaced
3416:bfb951e56c12 3417:68fdee3dd3ef
634 pid = fork(); 634 pid = fork();
635 635
636 if (pid == 0) { 636 if (pid == 0) {
637 char *args[4]; 637 char *args[4];
638 char command[1024]; 638 char command[1024];
639 639 char *quoted = NULL;
640
640 if (web_browser == BROWSER_OPERA) { 641 if (web_browser == BROWSER_OPERA) {
641 args[0] = "opera"; 642 args[0] = "opera";
642 args[1] = "-newwindow"; 643 args[1] = "-newwindow";
643 args[2] = url; 644 args[2] = url;
644 args[3] = NULL; 645 args[3] = NULL;
660 } else if (web_browser == BROWSER_MOZILLA) { 661 } else if (web_browser == BROWSER_MOZILLA) {
661 args[0] = "mozilla"; 662 args[0] = "mozilla";
662 args[1] = url; 663 args[1] = url;
663 args[2] = NULL; 664 args[2] = NULL;
664 } else if (web_browser == BROWSER_MANUAL) { 665 } else if (web_browser == BROWSER_MANUAL) {
665 char *quoted = g_shell_quote(command);
666 g_snprintf(command, sizeof(command), web_command, quoted); 666 g_snprintf(command, sizeof(command), web_command, quoted);
667 g_free(quoted); 667 quoted = g_shell_quote(command);
668 args[0] = "sh"; 668 args[0] = "sh";
669 args[1] = "-c"; 669 args[1] = "-c";
670 args[2] = command; 670 args[2] = quoted;
671 args[3] = NULL; 671 args[3] = NULL;
672 } 672 }
673 673
674 execvp(args[0], args); 674 execvp(args[0], args);
675 if (quoted)
676 g_free(quoted);
675 _exit(0); 677 _exit(0);
676 } 678 }
677 } 679 }
678 } 680 }
679 681