[uim-commit] r2635 - branches/1.0/uim
ekato at freedesktop.org
ekato at freedesktop.org
Sat Dec 17 06:25:36 PST 2005
Author: ekato
Date: 2005-12-17 06:25:30 -0800 (Sat, 17 Dec 2005)
New Revision: 2635
Modified:
branches/1.0/uim/skk.c
Log:
* uim/skk.c (look_popen) : Port r2634 from trunk.
Modified: branches/1.0/uim/skk.c
===================================================================
--- branches/1.0/uim/skk.c 2005-12-17 14:23:51 UTC (rev 2634)
+++ branches/1.0/uim/skk.c 2005-12-17 14:25:30 UTC (rev 2635)
@@ -55,6 +55,7 @@
#include <arpa/inet.h>
#include "uim-scm.h"
+#include "uim-helper.h"
#include "plugin.h"
#define skk_isalpha(ch) (skk_islower(ch) || skk_isupper(ch))
@@ -3341,18 +3342,24 @@
static FILE *
look_popen(const char *str)
{
- char *command;
+ char *cmd;
+ const char *look;
FILE *fp;
int len;
- len = strlen(LOOK_COMMAND) + strlen(str) + strlen(" 2>/dev/null") + 1;
- command = malloc(len + 1);
- if (!command)
+ if (uim_helper_is_setugid())
+ look = "/usr/bin/" LOOK_COMMAND;
+ else
+ look = LOOK_COMMAND;
+
+ len = strlen(look) + strlen(str) + strlen(" 2>/dev/null") + 1;
+ cmd = malloc(len + 1);
+ if (!cmd)
return NULL;
- snprintf(command, len + 1, "%s %s%s", LOOK_COMMAND, str, " 2>/dev/null");
- fp = popen(command, "r");
- free(command);
+ snprintf(cmd, len + 1, "%s %s%s", look, str, " 2>/dev/null");
+ fp = popen(cmd, "r");
+ free(cmd);
return fp;
}
More information about the uim-commit
mailing list