summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2006-11-28 13:19:51 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2006-11-28 13:19:51 +0000
commitc7c6e5ca0f2df2f71f4928bd27ac6e78069e1a04 (patch)
tree6f3299c86985c5576c20f084b3573223ffd83cad /app
parentae3e48afb29cd015e15e8657bb4329b85a9e6537 (diff)
restore a fix from X.Org that I lost in previous merge.
Diffstat (limited to 'app')
-rw-r--r--app/twm/src/menus.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/twm/src/menus.c b/app/twm/src/menus.c
index 5aa542015..eaf9cf9ee 100644
--- a/app/twm/src/menus.c
+++ b/app/twm/src/menus.c
@@ -2155,8 +2155,8 @@ ExecuteFunction(int func, char *action, Window w, TwmWindow *tmp_win,
break;
case F_FILE:
- action = ExpandFilename(action);
- fd = open(action, O_RDONLY);
+ ptr = ExpandFilename(action);
+ fd = open(ptr, O_RDONLY);
if (fd >= 0)
{
count = read(fd, buff, MAX_FILE_SIZE - 1);
@@ -2168,8 +2168,9 @@ ExecuteFunction(int func, char *action, Window w, TwmWindow *tmp_win,
else
{
fprintf (stderr, "%s: unable to open file \"%s\"\n",
- ProgramName, action);
+ ProgramName, ptr);
}
+ if (ptr != action) free(ptr);
break;
case F_REFRESH: