summaryrefslogtreecommitdiff
path: root/Build/source/texk/ptexenc
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/ptexenc')
-rw-r--r--Build/source/texk/ptexenc/ChangeLog4
-rw-r--r--Build/source/texk/ptexenc/ptexenc.c9
2 files changed, 11 insertions, 2 deletions
diff --git a/Build/source/texk/ptexenc/ChangeLog b/Build/source/texk/ptexenc/ChangeLog
index d377de77ba2..87d3808dd42 100644
--- a/Build/source/texk/ptexenc/ChangeLog
+++ b/Build/source/texk/ptexenc/ChangeLog
@@ -1,5 +1,9 @@
2012-11-20 Peter Breitenlohner <peb@mppmu.mpg.de>
+ * ptexenc.c: Use kpse_readable_file() with non-const arg.
+
+2012-11-20 Peter Breitenlohner <peb@mppmu.mpg.de>
+
* Makefile.am: Avoid use of deprecated INCLUDES.
2012-09-04 Peter Breitenlohner <peb@mppmu.mpg.de>
diff --git a/Build/source/texk/ptexenc/ptexenc.c b/Build/source/texk/ptexenc/ptexenc.c
index ed178a77b53..4c1d6acc11d 100644
--- a/Build/source/texk/ptexenc/ptexenc.c
+++ b/Build/source/texk/ptexenc/ptexenc.c
@@ -817,6 +817,7 @@ static void nkf_check(void)
/* 'mode' must be read */
FILE *nkf_open(const char *path, const char *mode) {
char buff[PATH_MAX * 2 + 20]; /* 20 is enough gaps */
+ char *name;
FILE *fp;
if (in_filter == NULL) {
@@ -830,10 +831,14 @@ FILE *nkf_open(const char *path, const char *mode) {
}
if (in_filter[0] == '\0') return fopen(path, mode);
- path = kpse_readable_file(path);
- if (path == NULL) return NULL; /* can't read */
+ name = xstrdup(path);
+ if (kpse_readable_file(name) == NULL) {
+ free(name);
+ return NULL; /* can't read */
+ }
sprintf(buff, "%.*s < '%.*s'", PATH_MAX, in_filter, PATH_MAX, path);
+ free(name);
/* fprintf(stderr, "\n`%s`", buff); */
fp = popen(buff , "r");
if (piped_num < NOFILE) piped_fp[piped_num++] = fp;