summaryrefslogtreecommitdiff
path: root/Build/source/texk/kpathsea/tex-file.c
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-11-10 01:47:02 +0000
committerKarl Berry <karl@freefriends.org>2010-11-10 01:47:02 +0000
commit0e7550a0de00291bf3a50ed57dff573524e169f6 (patch)
tree6584c5c380c7e8e063486d08bbeff0f7270c3bde /Build/source/texk/kpathsea/tex-file.c
parent3b2f26271608630ca56a88b528a1004f51535ea3 (diff)
avoid unportable passing of vararg list, http://bugs.debian.org/602566
git-svn-id: svn://tug.org/texlive/trunk@20390 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/kpathsea/tex-file.c')
-rw-r--r--Build/source/texk/kpathsea/tex-file.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/Build/source/texk/kpathsea/tex-file.c b/Build/source/texk/kpathsea/tex-file.c
index 7e5d501e32b..3370186d6a9 100644
--- a/Build/source/texk/kpathsea/tex-file.c
+++ b/Build/source/texk/kpathsea/tex-file.c
@@ -320,14 +320,13 @@ init_path (kpathsea kpse, kpse_format_info_type *info,
/* Some file types have more than one suffix, and sometimes it is
convenient to modify the list of searched suffixes. */
-void
-kpathsea_set_suffixes (kpathsea kpse, kpse_file_format_type format,
- boolean alternate, ...)
+static void
+kpathsea_set_suffixes_va_list (kpathsea kpse, kpse_file_format_type format,
+ boolean alternate, va_list ap)
{
const_string **list;
const_string s;
int count = 0;
- va_list ap;
if (alternate) {
list = &(kpse->format_info[format].alt_suffix);
@@ -335,16 +334,24 @@ kpathsea_set_suffixes (kpathsea kpse, kpse_file_format_type format,
list = &(kpse->format_info[format].suffix);
}
- va_start (ap, alternate);
while ((s = va_arg (ap, string)) != NULL) {
count++;
XRETALLOC (*list, count + 1, const_string);
(*list)[count - 1] = s;
}
- va_end (ap);
(*list)[count] = NULL;
}
+void
+kpathsea_set_suffixes (kpathsea kpse, kpse_file_format_type format,
+ boolean alternate, ...)
+{
+ va_list ap;
+ va_start (ap, alternate);
+ kpathsea_set_suffixes_va_list (kpse, format, alternate, ap);
+ va_end (ap);
+}
+
#if defined (KPSE_COMPAT_API)
void
@@ -353,7 +360,7 @@ kpse_set_suffixes (kpse_file_format_type format,
{
va_list ap;
va_start (ap, alternate);
- kpathsea_set_suffixes (kpse_def, format, alternate, ap);
+ kpathsea_set_suffixes_va_list (kpse_def, format, alternate, ap);
va_end (ap);
}
#endif