summaryrefslogtreecommitdiff
path: root/Build/source/texk/kpathsea
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2011-07-20 07:00:05 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2011-07-20 07:00:05 +0000
commit89755f7344de571c4b1b7c68e90de39363a4d1ff (patch)
treed735587f7030f0536272048df7a4b53cefc133a4 /Build/source/texk/kpathsea
parent713aef9b071ca2b5dd68d014e99897f0e5e2036c (diff)
libs/t1lib + texk/ps2pkm: bug fix and update
git-svn-id: svn://tug.org/texlive/trunk@23187 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/kpathsea')
-rw-r--r--Build/source/texk/kpathsea/ChangeLog60
-rw-r--r--Build/source/texk/kpathsea/Makefile.in7
-rw-r--r--Build/source/texk/kpathsea/ac/mktex.ac (renamed from Build/source/texk/kpathsea/ac/web2c.ac)4
-rw-r--r--Build/source/texk/kpathsea/ac/withenable.ac4
-rw-r--r--Build/source/texk/kpathsea/aclocal.m43
-rwxr-xr-xBuild/source/texk/kpathsea/configure140
-rw-r--r--Build/source/texk/kpathsea/configure.ac31
-rw-r--r--Build/source/texk/kpathsea/doc/Makefile.in7
-rw-r--r--Build/source/texk/kpathsea/find-suffix.c16
-rw-r--r--Build/source/texk/kpathsea/fontmap.c2
-rw-r--r--Build/source/texk/kpathsea/kpsewhich.c7
-rw-r--r--Build/source/texk/kpathsea/lib.h2
-rw-r--r--Build/source/texk/kpathsea/man/Makefile.in7
-rw-r--r--Build/source/texk/kpathsea/progname.c60
-rw-r--r--Build/source/texk/kpathsea/tex-file.c14
-rw-r--r--Build/source/texk/kpathsea/tex-glyph.c12
-rw-r--r--Build/source/texk/kpathsea/tex-glyph.h4
-rw-r--r--Build/source/texk/kpathsea/tex-make.c5
-rw-r--r--Build/source/texk/kpathsea/types.h4
-rw-r--r--Build/source/texk/kpathsea/version.ac24
-rw-r--r--Build/source/texk/kpathsea/xgetcwd.c30
21 files changed, 268 insertions, 175 deletions
diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog
index 4e843fee649..5c5990c95ed 100644
--- a/Build/source/texk/kpathsea/ChangeLog
+++ b/Build/source/texk/kpathsea/ChangeLog
@@ -1,3 +1,20 @@
+2011-07-15 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * version.ac: New file defining the kpathsea version.
+ Update version number 6.0.1 => 6.0.2dev.
+ * configure.ac: Adapt. Use KPSE_LT_VERSION.
+
+2011-07-12 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * ac/web2c.ac renamed into ac/mktex.ac.
+ * ac/withenable.ac, configure.ac: web2c.ac => mktex.ac.
+ * configure.ac: KPSE_WEB2C_PREPARE => KPSE_MKTEX_PREPARE.
+
+2011-06-29 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * tex-make.c [WIN32]: Do not #include <kpathsea/win32lib.h>
+ from here (already done from config.h).
+
2011-06-28 Karl Berry <karl@tug.org>
* mktexlsr: need to shift when arg is not a directory.
@@ -7,6 +24,49 @@
* texmf.cnf (OPENTYPEFONTS): a duplicate entry was created :(.
+2011-06-18 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * progname.c (remove_dots): Correctly handle dir="/foo/../bar".
+ FIXME: What about dir="c:foo/../bar" and dir="c:../bar"?
+
+2011-06-17 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ Reduce memory leaks.
+
+ * types.h (kpse_format_info_type): Declare path as non-const.
+ * tex-file.c (init_path): Free old value of path when assigning
+ a new value.
+
+ * progname.c (kpathsea_selfdir): Free strings no longer used.
+
+ * kpsewhich.c (lookup): Free string no longer used.
+
+2011-06-16 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * fontmap.c (kpathsea_fontmap_lookup), kpsewhich.c (find_dpi),
+ progname.c (kpathsea_set_program_name): Allow find_suffix() to
+ return a const string.
+
+ * find-suffix.c, lib.h: Declare find_suffix() as const.
+ * find-suffix.c: Explain that NAME+(find_suffix(NAME)-NAME) is
+ equivalent to find_suffix(NAME) but not necessarily const.
+
+ * progname.c (remove_dots): Somewhat reorganize (initialize
+ ret as `NULL' instead of `(string)""').
+
+2011-06-16 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * tex-glyph.c (try_size, try_fontmap, kpathsea_find_glyph),
+ tex-glyph.h (kpse_glyph_file_type): Declare font name as const.
+
+2011-06-16 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * xgetcwd.c: Fix #include directives (depend on GETCWD_FORKS).
+ (xgetcwd): The returned string may be long lived, so malloc()
+ only as needed.
+ Do not print path when getcwd(path, size) or getwd(path) fail,
+ the contents is undefined.
+
2011-06-13 Manuel P\'egour\'e-Gonnard <mpg@elzevir.fr>
* db.c (match): ensure that we are at a dir separator in
diff --git a/Build/source/texk/kpathsea/Makefile.in b/Build/source/texk/kpathsea/Makefile.in
index 71da2d945b2..bfeff0bc299 100644
--- a/Build/source/texk/kpathsea/Makefile.in
+++ b/Build/source/texk/kpathsea/Makefile.in
@@ -60,15 +60,16 @@ DIST_COMMON = README $(am__configure_deps) $(dist_noinst_DATA) \
strcasecmp.c strstr.c strtol.c
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../../m4/kpse-common.m4 \
+ $(top_srcdir)/../../m4/kpse-lib-version.m4 \
+ $(top_srcdir)/../../m4/kpse-mktex.m4 \
$(top_srcdir)/../../m4/kpse-warnings.m4 \
- $(top_srcdir)/../../m4/kpse-web2c.m4 \
$(top_srcdir)/../../m4/kpse-win32.m4 \
$(top_srcdir)/../../m4/libtool.m4 \
$(top_srcdir)/../../m4/ltoptions.m4 \
$(top_srcdir)/../../m4/ltsugar.m4 \
$(top_srcdir)/../../m4/ltversion.m4 \
- $(top_srcdir)/../../m4/lt~obsolete.m4 \
- $(top_srcdir)/ac/web2c.ac $(top_srcdir)/configure.ac
+ $(top_srcdir)/../../m4/lt~obsolete.m4 $(top_srcdir)/version.ac \
+ $(top_srcdir)/ac/mktex.ac $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
diff --git a/Build/source/texk/kpathsea/ac/web2c.ac b/Build/source/texk/kpathsea/ac/mktex.ac
index ccdd5c0a39d..fe8deeb9dbd 100644
--- a/Build/source/texk/kpathsea/ac/web2c.ac
+++ b/Build/source/texk/kpathsea/ac/mktex.ac
@@ -1,7 +1,7 @@
-## texk/kpathsea/ac/web2c.ac: configure.ac fragment for the TeX Live
+## texk/kpathsea/ac/mktex.ac: configure.ac fragment for the TeX Live
## subdirectory texk/kpathsea.
dnl
-dnl Copyright (C) 2009 Peter Breitenlohner <tex-live@tug.org>
+dnl Copyright (C) 2009, 2011 Peter Breitenlohner <tex-live@tug.org>
dnl You may freely use, modify and/or distribute this file.
dnl
## configure defaults for mktexfmt & Co.
diff --git a/Build/source/texk/kpathsea/ac/withenable.ac b/Build/source/texk/kpathsea/ac/withenable.ac
index a3a2a40c87e..1dfc28533bc 100644
--- a/Build/source/texk/kpathsea/ac/withenable.ac
+++ b/Build/source/texk/kpathsea/ac/withenable.ac
@@ -1,8 +1,8 @@
## texk/kpathsea/ac/withenable.ac: configure.ac fragment for the TeX Live subdirectory texk/kpathsea/
dnl
-dnl Copyright (C) 2009, 2010 Peter Breitenlohner <tex-live@tug.org>
+dnl Copyright (C) 2009-2011 Peter Breitenlohner <tex-live@tug.org>
dnl You may freely use, modify and/or distribute this file.
dnl
## configure options and TL libraries required for kpathsea
KPSE_WITH_TEXLIB([kpathsea])
-m4_include(kpse_TL[texk/kpathsea/ac/web2c.ac])
+m4_include(kpse_TL[texk/kpathsea/ac/mktex.ac])
diff --git a/Build/source/texk/kpathsea/aclocal.m4 b/Build/source/texk/kpathsea/aclocal.m4
index 4b100918b2c..244fd62f7ed 100644
--- a/Build/source/texk/kpathsea/aclocal.m4
+++ b/Build/source/texk/kpathsea/aclocal.m4
@@ -990,8 +990,9 @@ AC_SUBST([am__untar])
]) # _AM_PROG_TAR
m4_include([../../m4/kpse-common.m4])
+m4_include([../../m4/kpse-lib-version.m4])
+m4_include([../../m4/kpse-mktex.m4])
m4_include([../../m4/kpse-warnings.m4])
-m4_include([../../m4/kpse-web2c.m4])
m4_include([../../m4/kpse-win32.m4])
m4_include([../../m4/libtool.m4])
m4_include([../../m4/ltoptions.m4])
diff --git a/Build/source/texk/kpathsea/configure b/Build/source/texk/kpathsea/configure
index bfccd3b0ca6..07e7a6a6db0 100755
--- a/Build/source/texk/kpathsea/configure
+++ b/Build/source/texk/kpathsea/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for Kpathsea 6.0.1.
+# Generated by GNU Autoconf 2.68 for Kpathsea 6.0.2dev.
#
# Report bugs to <tex-k@tug.org>.
#
@@ -570,8 +570,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='Kpathsea'
PACKAGE_TARNAME='kpathsea'
-PACKAGE_VERSION='6.0.1'
-PACKAGE_STRING='Kpathsea 6.0.1'
+PACKAGE_VERSION='6.0.2dev'
+PACKAGE_STRING='Kpathsea 6.0.2dev'
PACKAGE_BUGREPORT='tex-k@tug.org'
PACKAGE_URL=''
@@ -1308,7 +1308,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures Kpathsea 6.0.1 to adapt to many kinds of systems.
+\`configure' configures Kpathsea 6.0.2dev to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1378,7 +1378,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of Kpathsea 6.0.1:";;
+ short | recursive ) echo "Configuration of Kpathsea 6.0.2dev:";;
esac
cat <<\_ACEOF
@@ -1494,7 +1494,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-Kpathsea configure 6.0.1
+Kpathsea configure 6.0.2dev
generated by GNU Autoconf 2.68
Copyright (C) 2010 Free Software Foundation, Inc.
@@ -2020,7 +2020,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by Kpathsea $as_me 6.0.1, which was
+It was created by Kpathsea $as_me 6.0.2dev, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@
@@ -2401,11 +2401,12 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
-KPSEVERSION=6.0.1
+KPSEVERSION=6.0.2dev
-$as_echo "#define KPSEVERSION \"kpathsea version 6.0.1\"" >>confdefs.h
+$as_echo "#define KPSEVERSION \"kpathsea version 6.0.2dev\"" >>confdefs.h
-KPSE_LT_VERSINFO=6:1:0
+
+KPSE_LT_VERSINFO=6:2:0
am__api_version='1.11'
@@ -7380,7 +7381,7 @@ fi
# Define the identity of the package.
PACKAGE='kpathsea'
- VERSION='6.0.1'
+ VERSION='6.0.2dev'
cat >>confdefs.h <<_ACEOF
@@ -12518,39 +12519,42 @@ $as_echo_n "checking what warning flags to pass to the C compiler... " >&6; }
if ${kpse_cv_warning_cflags+:} false; then :
$as_echo_n "(cached) " >&6
else
- if test "x$enable_compiler_warnings" = xno; then
+ if test "x$GCC" = xyes; then
kpse_cv_warning_cflags=
-elif test "x$GCC" = xyes; then
+if test "x$enable_compiler_warnings" != xno; then
kpse_cv_warning_cflags="-Wimplicit -Wreturn-type"
-case `$CC -dumpversion` in #(
+ case `$CC -dumpversion` in #(
3.4.* | 4.*) :
kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wdeclaration-after-statement" ;; #(
*) :
;;
esac
-case `$CC -dumpversion` in #(
+ case `$CC -dumpversion` in #(
3.[234].* | 4.*) :
kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wno-unknown-pragmas" ;; #(
*) :
;;
esac
-if test "x$enable_compiler_warnings" != xmin; then
- kpse_cv_warning_cflags="-Wall -Wunused $kpse_cv_warning_cflags"
- kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wmissing-prototypes -Wmissing-declarations"
- if test "x$enable_compiler_warnings" != xyes; then
- kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wparentheses -Wswitch -Wtrigraphs -Wpointer-arith"
- kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wcast-qual -Wcast-align -Wwrite-strings"
- case `$CC -dumpversion` in #(
+ if test "x$enable_compiler_warnings" != xmin; then
+ kpse_cv_warning_cflags="-Wall -Wunused $kpse_cv_warning_cflags"
+ kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wmissing-prototypes -Wmissing-declarations"
+ if test "x$enable_compiler_warnings" != xyes; then
+ kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wparentheses -Wswitch -Wtrigraphs -Wpointer-arith"
+ kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wcast-qual -Wcast-align -Wwrite-strings"
+ case `$CC -dumpversion` in #(
3.4.* | 4.*) :
kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wold-style-definition" ;; #(
*) :
;;
esac
- if test "x$enable_compiler_warnings" != xmax; then
- kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wshadow"
+ if test "x$enable_compiler_warnings" != xmax; then
+ kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wshadow"
+ fi
fi
fi
fi
+elif test "x$enable_compiler_warnings" = xno; then
+ kpse_cv_warning_cflags=
else
kpse_cv_warning_cflags= # FIXME: warning flags for non-GNU C compilers
fi
@@ -12566,81 +12570,45 @@ WARNING_CFLAGS=$kpse_cv_warning_cflags
-## texk/kpathsea/ac/web2c.ac: configure.ac fragment for the TeX Live
+## texk/kpathsea/ac/mktex.ac: configure.ac fragment for the TeX Live
## subdirectory texk/kpathsea.
## configure defaults for mktexfmt & Co.
# Check whether --enable-mktexmf-default was given.
if test "${enable_mktexmf_default+set}" = set; then :
enableval=$enable_mktexmf_default;
fi
-case $enable_mktexmf_default in #(
- yes|no) :
- ;; #(
- *) :
- enable_mktexmf_default=yes ;;
-esac
# Check whether --enable-mktexpk-default was given.
if test "${enable_mktexpk_default+set}" = set; then :
enableval=$enable_mktexpk_default;
fi
-case $enable_mktexpk_default in #(
- yes|no) :
- ;; #(
- *) :
- enable_mktexpk_default=yes ;;
-esac
# Check whether --enable-mktextfm-default was given.
if test "${enable_mktextfm_default+set}" = set; then :
enableval=$enable_mktextfm_default;
fi
-case $enable_mktextfm_default in #(
- yes|no) :
- ;; #(
- *) :
- enable_mktextfm_default=yes ;;
-esac
# Check whether --enable-mkocp-default was given.
if test "${enable_mkocp_default+set}" = set; then :
enableval=$enable_mkocp_default;
fi
-case $enable_mkocp_default in #(
- yes|no) :
- ;; #(
- *) :
- enable_mkocp_default=yes ;;
-esac
# Check whether --enable-mkofm-default was given.
if test "${enable_mkofm_default+set}" = set; then :
enableval=$enable_mkofm_default;
fi
-case $enable_mkofm_default in #(
- yes|no) :
- ;; #(
- *) :
- enable_mkofm_default=yes ;;
-esac
# Check whether --enable-mktexfmt-default was given.
if test "${enable_mktexfmt_default+set}" = set; then :
enableval=$enable_mktexfmt_default;
fi
-case $enable_mktexfmt_default in #(
- yes|no) :
- ;; #(
- *) :
- enable_mktexfmt_default=yes ;;
-esac
# Check whether --enable-mktextex-default was given.
if test "${enable_mktextex_default+set}" = set; then :
enableval=$enable_mktextex_default;
fi
-case $enable_mktextex_default in #(
- yes|no) :
+
+
+case $enable_mktexmf_default in #(
+ yes | no) :
;; #(
*) :
- enable_mktextex_default=no ;;
+ enable_mktexmf_default=yes ;;
esac
-
-
if test "x$enable_mktexmf_default" = xyes; then :
$as_echo "#define MAKE_TEX_MF_BY_DEFAULT 1" >>confdefs.h
@@ -12649,6 +12617,12 @@ else
$as_echo "#define MAKE_TEX_MF_BY_DEFAULT 0" >>confdefs.h
fi
+case $enable_mktexpk_default in #(
+ yes | no) :
+ ;; #(
+ *) :
+ enable_mktexpk_default=yes ;;
+esac
if test "x$enable_mktexpk_default" = xyes; then :
$as_echo "#define MAKE_TEX_PK_BY_DEFAULT 1" >>confdefs.h
@@ -12657,6 +12631,12 @@ else
$as_echo "#define MAKE_TEX_PK_BY_DEFAULT 0" >>confdefs.h
fi
+case $enable_mktextfm_default in #(
+ yes | no) :
+ ;; #(
+ *) :
+ enable_mktextfm_default=yes ;;
+esac
if test "x$enable_mktextfm_default" = xyes; then :
$as_echo "#define MAKE_TEX_TFM_BY_DEFAULT 1" >>confdefs.h
@@ -12665,6 +12645,12 @@ else
$as_echo "#define MAKE_TEX_TFM_BY_DEFAULT 0" >>confdefs.h
fi
+case $enable_mkocp_default in #(
+ yes | no) :
+ ;; #(
+ *) :
+ enable_mkocp_default=yes ;;
+esac
if test "x$enable_mkocp_default" = xyes; then :
$as_echo "#define MAKE_OMEGA_OCP_BY_DEFAULT 1" >>confdefs.h
@@ -12673,6 +12659,12 @@ else
$as_echo "#define MAKE_OMEGA_OCP_BY_DEFAULT 0" >>confdefs.h
fi
+case $enable_mkofm_default in #(
+ yes | no) :
+ ;; #(
+ *) :
+ enable_mkofm_default=yes ;;
+esac
if test "x$enable_mkofm_default" = xyes; then :
$as_echo "#define MAKE_OMEGA_OFM_BY_DEFAULT 1" >>confdefs.h
@@ -12681,6 +12673,12 @@ else
$as_echo "#define MAKE_OMEGA_OFM_BY_DEFAULT 0" >>confdefs.h
fi
+case $enable_mktexfmt_default in #(
+ yes | no) :
+ ;; #(
+ *) :
+ enable_mktexfmt_default=yes ;;
+esac
if test "x$enable_mktexfmt_default" = xyes; then :
$as_echo "#define MAKE_TEX_FMT_BY_DEFAULT 1" >>confdefs.h
@@ -12689,6 +12687,12 @@ else
$as_echo "#define MAKE_TEX_FMT_BY_DEFAULT 0" >>confdefs.h
fi
+case $enable_mktextex_default in #(
+ yes | no) :
+ ;; #(
+ *) :
+ enable_mktextex_default=no ;;
+esac
if test "x$enable_mktextex_default" = xyes; then :
$as_echo "#define MAKE_TEX_TEX_BY_DEFAULT 1" >>confdefs.h
@@ -13481,7 +13485,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by Kpathsea $as_me 6.0.1, which was
+This file was extended by Kpathsea $as_me 6.0.2dev, which was
generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -13547,7 +13551,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-Kpathsea config.status 6.0.1
+Kpathsea config.status 6.0.2dev
configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\"
diff --git a/Build/source/texk/kpathsea/configure.ac b/Build/source/texk/kpathsea/configure.ac
index df14e5abc9b..85d150031fa 100644
--- a/Build/source/texk/kpathsea/configure.ac
+++ b/Build/source/texk/kpathsea/configure.ac
@@ -1,32 +1,13 @@
dnl Process this file with autoconf to produce a configure script.
dnl
-dnl Copyright (C) 2009 - 2011 Peter Breitenlohner <tex-live@tug.org>
+dnl Copyright (C) 2009-2011 Peter Breitenlohner <tex-live@tug.org>
dnl
dnl This file is free software; the copyright holder
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
-dnl --------------------------------------------------------
-dnl Keep Kpathsea shared and package library versions the same:
-dnl Only bug fixes:
-dnl kpse_lib_micro += 1;
-dnl Adding new interfaces (backwards compatible)
-dnl kpse_lib_minor += 1;
-dnl kpse_lib_micro = 0;
-dnl Modifying or revoking interfaces (not backwards compatible)
-dnl kpse_lib_major += 1;
-dnl kpse_lib_minor = 0;
-dnl kpse_lib_micro = 0;
dnl
-dnl After a release, set kpse_lib_dev to "dev", to distinguish
-dnl binaries built between releases.
-
-m4_define([kpse_lib_major], [6])[]dnl
-m4_define([kpse_lib_minor], [0])[]dnl
-m4_define([kpse_lib_micro], [1])[]dnl
-m4_define([kpse_lib_devel], [])[]dnl empty or "dev"
-m4_define([kpse_version], [kpse_lib_major.kpse_lib_minor.kpse_lib_micro[]kpse_lib_devel])[]dnl
-
-AC_INIT([Kpathsea], [kpse_version], [tex-k@tug.org])
+m4_include([version.ac])[] dnl define kpse_version
+AC_INIT([Kpathsea], kpse_version, [tex-k@tug.org])
AC_PREREQ([2.65])
AC_CONFIG_SRCDIR([pathsearch.c])
AC_CONFIG_AUX_DIR([../../build-aux])
@@ -34,13 +15,13 @@ AC_CONFIG_MACRO_DIR([../../m4])
AC_SUBST([KPSEVERSION], [kpse_version])
AC_DEFINE([KPSEVERSION], ["kpathsea version kpse_version"])
-AC_SUBST([KPSE_LT_VERSINFO], [m4_eval(kpse_lib_major+kpse_lib_minor):kpse_lib_micro:kpse_lib_minor])
+KPSE_LT_VERSION([kpse])
dnl Common code for all programs using libkpathsea.
KPSE_COMMON([kpathsea])
dnl Include additional code for kpathsea.
-KPSE_WEB2C_PREPARE
-m4_sinclude([ac/web2c.ac])
+KPSE_MKTEX_PREPARE
+m4_sinclude([ac/mktex.ac])
dnl Generate MAKE_TEX_*_BY_DEFAULT and MAKE_OMEGA_*_BY_DEFAULT defines.
m4_foreach([Kpse_Mktex], [kpse_mktex_opts],
diff --git a/Build/source/texk/kpathsea/doc/Makefile.in b/Build/source/texk/kpathsea/doc/Makefile.in
index 08c6e3179b5..92fd673df51 100644
--- a/Build/source/texk/kpathsea/doc/Makefile.in
+++ b/Build/source/texk/kpathsea/doc/Makefile.in
@@ -38,15 +38,16 @@ DIST_COMMON = $(kpathsea_TEXINFOS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../../m4/kpse-common.m4 \
+ $(top_srcdir)/../../m4/kpse-lib-version.m4 \
+ $(top_srcdir)/../../m4/kpse-mktex.m4 \
$(top_srcdir)/../../m4/kpse-warnings.m4 \
- $(top_srcdir)/../../m4/kpse-web2c.m4 \
$(top_srcdir)/../../m4/kpse-win32.m4 \
$(top_srcdir)/../../m4/libtool.m4 \
$(top_srcdir)/../../m4/ltoptions.m4 \
$(top_srcdir)/../../m4/ltsugar.m4 \
$(top_srcdir)/../../m4/ltversion.m4 \
- $(top_srcdir)/../../m4/lt~obsolete.m4 \
- $(top_srcdir)/ac/web2c.ac $(top_srcdir)/configure.ac
+ $(top_srcdir)/../../m4/lt~obsolete.m4 $(top_srcdir)/version.ac \
+ $(top_srcdir)/ac/mktex.ac $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
diff --git a/Build/source/texk/kpathsea/find-suffix.c b/Build/source/texk/kpathsea/find-suffix.c
index 6fbb1f28c6b..107e1917de0 100644
--- a/Build/source/texk/kpathsea/find-suffix.c
+++ b/Build/source/texk/kpathsea/find-suffix.c
@@ -23,11 +23,23 @@
/* Return pointer to first character after `.' in last directory element
of NAME. If the name is `foo' or `/foo.bar/baz', we have no extension. */
-string
+/* The the result of strrchr(NAME, '.'), when not NULL, is a non-const
+ pointer into the string NAME. However, this is cheating (motivated
+ by limitations of the C language) when the argument NAME is a
+ const string, because in that case the (technically non-const) result
+ from strrchr() is certainly not modifiable.
+
+ We do not want to repeat this kind of cheating for find_suffix() and
+ therefore declare find_suffix(NAME) as const. When find_suffix(NAME)
+ is non-NULL and the argument NAME is modifiable (i.e., non-const)
+ then NAME+(find_suffix(NAME)-NAME) is an equivalent modifiable string
+ and the pointer arithmetic is optimized away by modern compilers. */
+
+const_string
find_suffix (const_string name)
{
const_string slash_pos;
- string dot_pos = strrchr (name, '.');
+ const_string dot_pos = strrchr (name, '.');
if (dot_pos == NULL)
return NULL;
diff --git a/Build/source/texk/kpathsea/fontmap.c b/Build/source/texk/kpathsea/fontmap.c
index 2ed383d519e..73c7227b593 100644
--- a/Build/source/texk/kpathsea/fontmap.c
+++ b/Build/source/texk/kpathsea/fontmap.c
@@ -172,7 +172,7 @@ const_string *
kpathsea_fontmap_lookup (kpathsea kpse, const_string key)
{
const_string *ret;
- string suffix = find_suffix (key);
+ const_string suffix = find_suffix (key);
if (kpse->map.size == 0) {
read_all_maps (kpse);
diff --git a/Build/source/texk/kpathsea/kpsewhich.c b/Build/source/texk/kpathsea/kpsewhich.c
index 7746bd7058d..7c453bc8eb0 100644
--- a/Build/source/texk/kpathsea/kpsewhich.c
+++ b/Build/source/texk/kpathsea/kpsewhich.c
@@ -129,7 +129,7 @@ static unsigned
find_dpi (string s)
{
unsigned dpi_number = 0;
- string extension = find_suffix (s);
+ const_string extension = find_suffix (s);
if (extension != NULL)
sscanf (extension, "%u", &dpi_number);
@@ -342,12 +342,15 @@ lookup (kpathsea kpse, string name)
case kpse_any_glyph_format:
{
kpse_glyph_file_type glyph_ret;
+ string temp = remove_suffix (name);
/* Try to extract the resolution from the name. */
unsigned local_dpi = find_dpi (name);
if (!local_dpi)
local_dpi = dpi;
- ret = kpathsea_find_glyph (kpse, remove_suffix (name),
+ ret = kpathsea_find_glyph (kpse, temp,
local_dpi, fmt, &glyph_ret);
+ if (temp != name)
+ free (temp);
}
break;
diff --git a/Build/source/texk/kpathsea/lib.h b/Build/source/texk/kpathsea/lib.h
index d4ded1e55fe..23ef34e3147 100644
--- a/Build/source/texk/kpathsea/lib.h
+++ b/Build/source/texk/kpathsea/lib.h
@@ -152,7 +152,7 @@ extern string strstr (const_string haystack, const_string needle);
/* If NAME has a suffix, return a pointer to its first character (i.e.,
the one after the `.'); otherwise, return NULL. */
-extern KPSEDLL string find_suffix (const_string name);
+extern KPSEDLL const_string find_suffix (const_string name);
/* Return NAME with any suffix removed. */
extern KPSEDLL string remove_suffix (const_string name);
diff --git a/Build/source/texk/kpathsea/man/Makefile.in b/Build/source/texk/kpathsea/man/Makefile.in
index 7a14ae6e4d1..f744c256fe5 100644
--- a/Build/source/texk/kpathsea/man/Makefile.in
+++ b/Build/source/texk/kpathsea/man/Makefile.in
@@ -38,15 +38,16 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
subdir = man
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../../m4/kpse-common.m4 \
+ $(top_srcdir)/../../m4/kpse-lib-version.m4 \
+ $(top_srcdir)/../../m4/kpse-mktex.m4 \
$(top_srcdir)/../../m4/kpse-warnings.m4 \
- $(top_srcdir)/../../m4/kpse-web2c.m4 \
$(top_srcdir)/../../m4/kpse-win32.m4 \
$(top_srcdir)/../../m4/libtool.m4 \
$(top_srcdir)/../../m4/ltoptions.m4 \
$(top_srcdir)/../../m4/ltsugar.m4 \
$(top_srcdir)/../../m4/ltversion.m4 \
- $(top_srcdir)/../../m4/lt~obsolete.m4 \
- $(top_srcdir)/ac/web2c.ac $(top_srcdir)/configure.ac
+ $(top_srcdir)/../../m4/lt~obsolete.m4 $(top_srcdir)/version.ac \
+ $(top_srcdir)/ac/mktex.ac $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
diff --git a/Build/source/texk/kpathsea/progname.c b/Build/source/texk/kpathsea/progname.c
index b86e1348690..debae9e205e 100644
--- a/Build/source/texk/kpathsea/progname.c
+++ b/Build/source/texk/kpathsea/progname.c
@@ -270,33 +270,30 @@ remove_dots (kpathsea kpse, string dir)
#else
string c;
unsigned len;
- string ret = (string) ""; /* We always reassign. */
+ string ret = NULL;
for (c = kpathsea_filename_component (kpse, dir); c;
c = kpathsea_filename_component (kpse, NULL)) {
if (STREQ (c, ".")) {
/* If leading ., replace with cwd. Else ignore. */
- if (*ret == 0) {
+ if (!ret) {
ret = xgetcwd ();
}
} else if (STREQ (c, "..")) {
/* If leading .., start with xdirname (cwd). Else remove last
component from ret, if any. */
- if (*ret == 0) {
+ if (!ret) {
string dot = xgetcwd ();
ret = xdirname (dot);
free (dot);
} else {
unsigned last;
- for (last = strlen (ret);
- last > (NAME_BEGINS_WITH_DEVICE (ret) ? 2 : 0);
- last--) {
- if (IS_DIR_SEP (ret[last - 1])) {
+ string p = NAME_BEGINS_WITH_DEVICE (ret) ? ret + 2 : ret;
+ for (last = strlen (p); last > 0; last--) {
+ if (IS_DIR_SEP (p[last - 1])) {
/* If we have `/../', that's the same as `/'. */
- if (last > 1) {
- ret[last - 1] = 0;
- }
+ p[(last - 1 ? last - 1 : 1)] = 0;
break;
}
}
@@ -306,17 +303,17 @@ remove_dots (kpathsea kpse, string dir)
/* Not . or ..; just append. Include a directory separator unless
our string already ends with one. This also changes all directory
separators into the canonical DIR_SEP_STRING. */
- string temp;
- len = strlen (ret);
- temp = concat3 (ret, ((len > 0 && ret[len - 1] == DIR_SEP)
- || (NAME_BEGINS_WITH_DEVICE (c) && *ret == 0))
- ? "" : DIR_SEP_STRING,
- c);
- if (*ret)
- free (ret);
- ret = temp;
+ if (!ret) {
+ ret = concat (NAME_BEGINS_WITH_DEVICE (c) ? "" : DIR_SEP_STRING, c);
+ } else {
+ string temp = ret;
+ len = strlen (ret);
+ ret = concat3 (ret, ret[len - 1] == DIR_SEP ? "" : DIR_SEP_STRING, c);
+ free (temp);
+ }
}
}
+ assert (ret);
/* Remove a trailing /, just in case it snuck in. */
len = strlen (ret);
@@ -336,6 +333,7 @@ kpathsea_selfdir (kpathsea kpse, const_string argv0)
{
string ret = NULL;
string self = NULL;
+ string name;
if (kpathsea_absolute_p (kpse, argv0, true)) {
self = xstrdup (argv0);
@@ -369,8 +367,6 @@ kpathsea_selfdir (kpathsea kpse, const_string argv0)
want to search any ls-R's or do anything special with //'s. */
for (elt = kpathsea_path_element (kpse, getenv ("PATH")); !self && elt;
elt = kpathsea_path_element (kpse, NULL)) {
- string name;
-
/* UNIX tradition interprets the empty path element as "." */
if (*elt == 0) elt = ".";
@@ -383,11 +379,12 @@ kpathsea_selfdir (kpathsea kpse, const_string argv0)
only executable by some classes and not others. See the
`file_status' function in execute_cmd.c in bash for what's
necessary if we were to do it right. */
- if (stat (name, &s) == 0 && s.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH)) {
- /* Do not stop at directories. */
- if (!S_ISDIR(s.st_mode))
- self = name;
- }
+ if (stat (name, &s) == 0 && s.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH)
+ /* Do not stop at directories. */
+ && !S_ISDIR(s.st_mode))
+ self = name;
+ else
+ free (name);
}
#endif /* not AMIGA */
}
@@ -396,9 +393,15 @@ kpathsea_selfdir (kpathsea kpse, const_string argv0)
if (!self)
self = concat3 (".", DIR_SEP_STRING, argv0);
- ret = xdirname (remove_dots (kpse, expand_symlinks (kpse, self)));
+ name = remove_dots (kpse, expand_symlinks (kpse, self));
+#ifndef AMIGA
free (self);
+#endif
+
+ ret = xdirname (name);
+
+ free (name);
return ret;
}
@@ -470,7 +473,8 @@ void
kpathsea_set_program_name (kpathsea kpse, const_string argv0,
const_string progname)
{
- string ext, sdir, sdir_parent, sdir_grandparent;
+ const_string ext;
+ string sdir, sdir_parent, sdir_grandparent;
string s = getenv ("KPATHSEA_DEBUG");
#ifdef WIN32
string debug_output = getenv("KPATHSEA_DEBUG_OUTPUT");
diff --git a/Build/source/texk/kpathsea/tex-file.c b/Build/source/texk/kpathsea/tex-file.c
index 0dd86a603fc..da1af2ee47d 100644
--- a/Build/source/texk/kpathsea/tex-file.c
+++ b/Build/source/texk/kpathsea/tex-file.c
@@ -1,6 +1,6 @@
/* tex-file.c: high-level file searching by format.
- Copyright 1993, 1994, 1995, 1996, 1997, 2007, 2008, 2009, 2010 Karl Berry.
+ Copyright 1993, 1994, 1995, 1996, 1997, 2007, 2008, 2009, 2010, 2011 Karl Berry.
Copyright 1998-2005 Olaf Weber.
This library is free software; you can redistribute it and/or
@@ -223,7 +223,9 @@ kpse_maketex_option (const_string fmtname, boolean value)
#define EXPAND_DEFAULT(try_path, source_string) \
if (try_path) { \
info->raw_path = try_path; \
+ tmp = info->path; \
info->path = kpathsea_expand_default (kpse, try_path, info->path); \
+ free (tmp); \
info->path_source = source_string; \
}
@@ -240,6 +242,7 @@ init_path (kpathsea kpse, kpse_format_info_type *info,
string env_name;
string env_value = NULL;
string var = NULL;
+ string tmp;
va_list ap;
info->default_path = default_path;
@@ -291,7 +294,8 @@ init_path (kpathsea kpse, kpse_format_info_type *info,
bottom are guaranteed to exist. */
/* Assume we can reliably start with the compile-time default. */
- info->path = info->raw_path = info->default_path;
+ info->raw_path = info->default_path;
+ info->path = xstrdup (info->raw_path);
info->path_source = "compile-time paths.h";
EXPAND_DEFAULT (info->cnf_path, "texmf.cnf");
@@ -313,7 +317,9 @@ init_path (kpathsea kpse, kpse_format_info_type *info,
}
EXPAND_DEFAULT (info->override_path, "application override variable");
+ tmp = info->path;
info->path = kpathsea_brace_expand (kpse, info->path);
+ free (tmp);
}
@@ -1391,10 +1397,10 @@ kpathsea_reset_program_name (kpathsea kpse, const_string progname)
to 100k if this function is called. */
if (i == kpse_cnf_format || i == kpse_db_format)
continue;
- /* Wipe the path (it is tested) and the cnf_path and because their
+ /* Wipe the path (it is tested) and the cnf_path because their
values may differ with the new program name. */
if (kpse->format_info[i].path != NULL) {
- free ((string)kpse->format_info[i].path);
+ free (kpse->format_info[i].path);
kpse->format_info[i].path = NULL;
}
/* We cannot free the cnf_path: it points into the cnf hash, which
diff --git a/Build/source/texk/kpathsea/tex-glyph.c b/Build/source/texk/kpathsea/tex-glyph.c
index b3b9174a50b..f4ca45939dc 100644
--- a/Build/source/texk/kpathsea/tex-glyph.c
+++ b/Build/source/texk/kpathsea/tex-glyph.c
@@ -1,6 +1,6 @@
/* tex-glyph.c: search for GF/PK files.
- Copyright 1993, 1994, 1995, 1996, 2008, 2009 Karl Berry.
+ Copyright 1993, 1994, 1995, 1996, 2008, 2009, 2011 Karl Berry.
Copyright 1997, 1998, 1999, 2005 Olaf Weber.
This library is free software; you can redistribute it and/or
@@ -101,8 +101,8 @@ try_size (kpathsea kpse, const_string fontname, unsigned dpi,
}
if (ret != NULL && glyph_file)
- { /* Success. Fill in the return info. Discard const. */
- glyph_file->name = (string) fontname;
+ { /* Success. Fill in the return info. */
+ glyph_file->name = fontname;
glyph_file->dpi = dpi;
glyph_file->format = format_found;
}
@@ -145,12 +145,12 @@ try_resolution (kpathsea kpse, const_string fontname, unsigned dpi,
mktexpk to only deal with real names.) */
static string
-try_fontmap (kpathsea kpse, string *fontname_ptr, unsigned dpi,
+try_fontmap (kpathsea kpse, const_string *fontname_ptr, unsigned dpi,
kpse_file_format_type format,
kpse_glyph_file_type *glyph_file)
{
const_string *mapped_names;
- string fontname = *fontname_ptr;
+ const_string fontname = *fontname_ptr;
string ret = NULL;
mapped_names = kpathsea_fontmap_lookup (kpse, fontname);
@@ -255,7 +255,7 @@ kpathsea_find_glyph (kpathsea kpse,
{
string ret;
kpse_glyph_source_type source;
- string fontname = (string) passed_fontname; /* discard const */
+ const_string fontname = passed_fontname;
/* Start the search: try the name we're given. */
source = kpse_glyph_source_normal;
diff --git a/Build/source/texk/kpathsea/tex-glyph.h b/Build/source/texk/kpathsea/tex-glyph.h
index 971749c1ca4..f2a8c67f7f4 100644
--- a/Build/source/texk/kpathsea/tex-glyph.h
+++ b/Build/source/texk/kpathsea/tex-glyph.h
@@ -1,6 +1,6 @@
/* tex-glyph.h: look for a TeX glyph font (GF or PK).
- Copyright 1993, 2008, 2009 Karl Berry.
+ Copyright 1993, 2008, 2009, 2011 Karl Berry.
Copyright 1999, 2005 Olaf Weber.
This library is free software; you can redistribute it and/or
@@ -35,7 +35,7 @@ typedef enum
typedef struct
{
- string name; /* font name found */
+ const_string name; /* font name found */
unsigned dpi; /* size found, for glyphs */
kpse_file_format_type format; /* glyph format found */
kpse_glyph_source_type source; /* where we found it */
diff --git a/Build/source/texk/kpathsea/tex-make.c b/Build/source/texk/kpathsea/tex-make.c
index 16918f8c36a..e54a0d4a368 100644
--- a/Build/source/texk/kpathsea/tex-make.c
+++ b/Build/source/texk/kpathsea/tex-make.c
@@ -1,6 +1,6 @@
/* tex-make.c: run external programs to make TeX-related files.
- Copyright 1993, 1994, 1995, 1996, 1997, 2008, 2009, 2010 Karl Berry.
+ Copyright 1993, 1994, 1995, 1996, 1997, 2008, 2009, 2010, 2011 Karl Berry.
Copyright 1997, 1998, 2001-05 Olaf Weber.
This library is free software; you can redistribute it and/or
@@ -26,9 +26,6 @@
#include <kpathsea/readable.h>
#include <kpathsea/tex-make.h>
#include <kpathsea/variable.h>
-#if defined(WIN32) && !defined(__MINGW32__)
-#include <kpathsea/win32lib.h>
-#endif
#if !defined (AMIGA) && !(defined (MSDOS) && !defined(__DJGPP__)) && !defined (WIN32)
#include <sys/wait.h>
diff --git a/Build/source/texk/kpathsea/types.h b/Build/source/texk/kpathsea/types.h
index f6ac30b1444..aa8ef089320 100644
--- a/Build/source/texk/kpathsea/types.h
+++ b/Build/source/texk/kpathsea/types.h
@@ -1,6 +1,6 @@
/* types.h: general types for kpathsea.
- Copyright 1993, 1995, 1996, 2005, 2008, 2009, 2010 Karl Berry.
+ Copyright 1993, 1995, 1996, 2005, 2008, 2009, 2010, 2011 Karl Berry.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -169,7 +169,7 @@ typedef enum
typedef struct
{
const_string type; /* Human-readable description. */
- const_string path; /* The search path to use. */
+ string path; /* The search path to use. */
const_string raw_path; /* Pre-$~ (but post-default) expansion. */
const_string path_source; /* Where the path started from. */
const_string override_path; /* From client environment variable. */
diff --git a/Build/source/texk/kpathsea/version.ac b/Build/source/texk/kpathsea/version.ac
new file mode 100644
index 00000000000..57449a852ad
--- /dev/null
+++ b/Build/source/texk/kpathsea/version.ac
@@ -0,0 +1,24 @@
+dnl
+dnl Copyright (C) 2011 Peter Breitenlohner <tex-live@tug.org>
+dnl
+dnl This file is free software; the copyright holder
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl --------------------------------------------------------
+dnl Keep Kpathsea package and shared library versions the same:
+dnl Only bug fixes:
+dnl a.b.c => a.b.c+1
+dnl Adding new interfaces (backwards compatible)
+dnl a.b.c => a.b+1.0
+dnl Modifying or revoking interfaces (not backwards compatible)
+dnl a.b.c => a+1.b.c
+dnl kpse_lib_minor = 0;
+dnl kpse_lib_micro = 0;
+dnl
+dnl After a release:
+dnl append "dev", to distinguish binaries built between releases.
+dnl --------------------------------------------------------
+dnl
+dnl m4-include this file to define the current kpathsea version
+m4_define([kpse_version], [6.0.2dev])
diff --git a/Build/source/texk/kpathsea/xgetcwd.c b/Build/source/texk/kpathsea/xgetcwd.c
index 905775d0fa1..bde9102d845 100644
--- a/Build/source/texk/kpathsea/xgetcwd.c
+++ b/Build/source/texk/kpathsea/xgetcwd.c
@@ -1,6 +1,6 @@
/* xgetcwd.c: a from-scratch version of getwd. Ideas from tcsh 5.20 source.
- Copyright 1992, 1994, 1996, 2008 Karl Berry.
+ Copyright 1992, 1994, 1996, 2008, 2011 Karl Berry.
Copyright 2005 Olaf Weber.
This library is free software; you can redistribute it and/or
@@ -18,9 +18,9 @@
#include <kpathsea/config.h>
-#if defined (HAVE_GETCWD) || defined (HAVE_GETWD)
+#if (defined (HAVE_GETCWD) && !defined (GETCWD_FORKS)) || defined (HAVE_GETWD)
#include <kpathsea/c-pathmx.h>
-#else /* not HAVE_GETCWD && not HAVE_GETWD*/
+#else /* (not HAVE_GETCWD || GETCWD_FORKS) && not HAVE_GETWD */
#include <kpathsea/c-dir.h>
#include <kpathsea/xopendir.h>
#include <kpathsea/xstat.h>
@@ -33,7 +33,7 @@ xchdir (string dirname)
_PERROR(dirname);
}
-#endif /* not HAVE_GETCWD && not HAVE_GETWD */
+#endif /* (not HAVE_GETCWD || GETCWD_FORKS) && not HAVE_GETWD */
/* Return the pathname of the current directory, or give a fatal error. */
@@ -48,24 +48,22 @@ xgetcwd (void)
is not detected by configure, let me know.
-- Olaf Weber <infovore@xs4all.nl */
#if defined (HAVE_GETCWD) && !defined (GETCWD_FORKS)
- string path = (string)xmalloc(PATH_MAX + 1);
+ char path[PATH_MAX + 1];
- if (getcwd (path, PATH_MAX + 1) == 0) {
- fprintf(stderr, "getcwd: %s", path);
- exit(EXIT_FAILURE);
+ if (getcwd (path, PATH_MAX + 1) == NULL) {
+ FATAL_PERROR ("getcwd");
}
- return path;
+ return xstrdup (path);
#elif defined (HAVE_GETWD)
- string path = (string)xmalloc(PATH_MAX + 1);
+ char path[PATH_MAX + 1];
- if (getwd (path) == 0) {
- fprintf(stderr, "getwd: %s", path);
- exit(EXIT_FAILURE);
+ if (getwd (path) == NULL) {
+ FATAL_PERROR ("getwd");
}
- return path;
-#else /* not HAVE_GETCWD && not HAVE_GETWD */
+ return xstrdup (path);
+#else /* (not HAVE_GETCWD || GETCWD_FORKS) && not HAVE_GETWD */
struct stat root_stat, cwd_stat;
string cwd_path = (string)xmalloc(2); /* In case we assign "/" below. */
@@ -143,5 +141,5 @@ xgetcwd (void)
#endif
return cwd_path;
-#endif /* not HAVE_GETCWD && not HAVE_GETWD */
+#endif /* (not HAVE_GETCWD || GETCWD_FORKS) && not HAVE_GETWD */
}