summaryrefslogtreecommitdiff
path: root/Build/source/texk/kpathsea
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2011-04-11 10:01:47 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2011-04-11 10:01:47 +0000
commit83862d353cdf1a3d0d97c35fb2e5031ca31b3b22 (patch)
tree03756786c02b0167b4f49dc36af9abe597732d90 /Build/source/texk/kpathsea
parent717d1f8e302106991da10e5e68a9fe0e8d5e7087 (diff)
Avoid using strcpy() for overlapping strings
TEXEDIT: use texworks instead of vi for Windows git-svn-id: svn://tug.org/texlive/trunk@22043 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/kpathsea')
-rw-r--r--Build/source/texk/kpathsea/ChangeLog7
-rw-r--r--Build/source/texk/kpathsea/tex-file.c19
-rw-r--r--Build/source/texk/kpathsea/texmf.cnf3
3 files changed, 18 insertions, 11 deletions
diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog
index 7611adf7a2e..6ae5734dbaa 100644
--- a/Build/source/texk/kpathsea/ChangeLog
+++ b/Build/source/texk/kpathsea/ChangeLog
@@ -1,3 +1,10 @@
+2011-04-11 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * texmf.cnf (TEXEDIT): Document Unix and Windows defaults.
+
+ * tex-file.c (executable_filep): Avoid using strcpy() for
+ overlapping strings.
+
2011-03-22 Karl Berry <karl@tug.org>
* texmf.cnf (TEXINPUTS.eptex, TEXINPUTS.eplatex): define,
diff --git a/Build/source/texk/kpathsea/tex-file.c b/Build/source/texk/kpathsea/tex-file.c
index 0e069721f53..741ba2b0ada 100644
--- a/Build/source/texk/kpathsea/tex-file.c
+++ b/Build/source/texk/kpathsea/tex-file.c
@@ -1231,6 +1231,7 @@ Isspace (char c)
static boolean
executable_filep (kpathsea kpse, const_string fname, boolean silent)
{
+ const_string fn;
string p, q, base;
string *pp;
@@ -1241,17 +1242,15 @@ executable_filep (kpathsea kpse, const_string fname, boolean silent)
/* get base name
we cannot use xbasename() for abnormal names.
*/
- base = xstrdup (fname);
p = strrchr (fname, '/');
- if (p) {
- p++;
- strcpy (base, p);
- }
- p = strrchr (base, '\\');
- if (p) {
- p++;
- strcpy (base, p);
- }
+ if (p)
+ fn = p + 1;
+ else
+ fn = fname;
+ p = strrchr (fn, '\\');
+ if (p)
+ fn = p + 1;
+ base = xstrdup (fn);
#if defined(__CYGWIN__)
for (p = base; *p; p++)
*p = TOLOWER (*p);
diff --git a/Build/source/texk/kpathsea/texmf.cnf b/Build/source/texk/kpathsea/texmf.cnf
index f530952fe5f..1cb0ee9b369 100644
--- a/Build/source/texk/kpathsea/texmf.cnf
+++ b/Build/source/texk/kpathsea/texmf.cnf
@@ -580,7 +580,8 @@ TEX = etex
% interactive `e' option. %d is replaced by the line number and %s by
% the current filename. The default is specified at compile-time, and
% we let that stay in place since different platforms like different values.
-%TEXEDIT = vi +%d "%s"
+%TEXEDIT = vi +%d '%s' % default for Unix
+%TEXEDIT = texworks --position=+%d "%s" % default for Windows
%MFEDIT = ${TEXEDIT}
%MPEDIT = ${TEXEDIT}