Mercurial > pidgin
comparison src/gtkpounce.c @ 10913:44e91a7708eb
[gaim-migrate @ 12669]
Fix 1196574 - invalid charset when executing commands
Could someone check that this doesn't break anything on windows please?
committer: Tailor Script <tailor@pidgin.im>
author | Stu Tomlinson <stu@nosnilmot.com> |
---|---|
date | Sat, 14 May 2005 13:52:03 +0000 |
parents | 5cda52915a1f |
children | 9f75886e4f1f |
comparison
equal
deleted
inserted
replaced
10912:dcbc56eb3f37 | 10913:44e91a7708eb |
---|---|
1012 } | 1012 } |
1013 | 1013 |
1014 if (gaim_pounce_action_is_enabled(pounce, "execute-command")) | 1014 if (gaim_pounce_action_is_enabled(pounce, "execute-command")) |
1015 { | 1015 { |
1016 const char *command; | 1016 const char *command; |
1017 char *localecmd; | |
1017 | 1018 |
1018 command = gaim_pounce_action_get_attribute(pounce, "execute-command", | 1019 command = gaim_pounce_action_get_attribute(pounce, "execute-command", |
1019 "command"); | 1020 "command"); |
1020 | 1021 localecmd = g_locale_from_utf8(command, -1, NULL, NULL, NULL); |
1021 if (command != NULL) | 1022 |
1023 if (localecmd != NULL) | |
1022 { | 1024 { |
1023 #ifndef _WIN32 | 1025 #ifndef _WIN32 |
1024 int pid = fork(); | 1026 int pid = fork(); |
1025 | 1027 |
1026 if (pid == 0) { | 1028 if (pid == 0) { |
1027 char *args[4]; | 1029 char *args[4]; |
1028 | 1030 |
1029 args[0] = "sh"; | 1031 args[0] = "sh"; |
1030 args[1] = "-c"; | 1032 args[1] = "-c"; |
1031 args[2] = (char *)command; | 1033 args[2] = (char *)localecmd; |
1032 args[3] = NULL; | 1034 args[3] = NULL; |
1033 | 1035 |
1034 execvp(args[0], args); | 1036 execvp(args[0], args); |
1035 | 1037 |
1036 _exit(0); | 1038 _exit(0); |
1047 gaim_debug_info("pounce", | 1049 gaim_debug_info("pounce", |
1048 "Pounce execute command called for: %s\n", | 1050 "Pounce execute command called for: %s\n", |
1049 command); | 1051 command); |
1050 #endif /* !_WIN32 */ | 1052 #endif /* !_WIN32 */ |
1051 } | 1053 } |
1054 g_free(localecmd); | |
1052 } | 1055 } |
1053 | 1056 |
1054 if (gaim_pounce_action_is_enabled(pounce, "play-sound")) | 1057 if (gaim_pounce_action_is_enabled(pounce, "play-sound")) |
1055 { | 1058 { |
1056 const char *sound; | 1059 const char *sound; |