diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2012-12-13 11:20:26 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2012-12-13 11:20:26 +0000 |
commit | 98b38818d5618fce1e1cf6e95a924e206249eb42 (patch) | |
tree | fe9f1689584277105855987d376ca8692490bfdb /Build/source/texk/ptexenc | |
parent | 98b3e920b0a94a24517b8ccede04d1a9a3cc9c3f (diff) |
kpathsea: Resolve remaining const related problems
web2c, ptexenc: Adapt
git-svn-id: svn://tug.org/texlive/trunk@28521 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/ptexenc')
-rw-r--r-- | Build/source/texk/ptexenc/ChangeLog | 4 | ||||
-rw-r--r-- | Build/source/texk/ptexenc/ptexenc.c | 9 |
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; |