[tex-k] Locale-related bug in MakeIndex (was: makeindex breaks up index group on a capitalized entry)

geolsoft at mail.ru geolsoft at mail.ru
Mon Nov 1 21:05:09 CET 2004


Dear all,

Please refer to an old thread from back in August

    http://tug.org/pipermail/tex-k/2004-August/001046.html

I understood that MakeIndex was no longer maintained, and
the thread died out without much coming out of it.

I managed to solve the problem for myself (with help from
Stepan Kasal <kasal at ucw.cz>), but recently have seen the
same problem mentioned on another list.

I am wondering whether it is possible for somebody to apply
the patch to MakeIndex?  It would be nice if other people
could profit from locale-enabled indexes.

Please find the patch below.


Many thanks,
Oleg Katsitadze


--- makeindexk.orig/genind.c	2004-11-01 19:27:09.000000000 +0200
+++ makeindexk/genind.c	2004-11-01 19:43:11.000000000 +0200
@@ -28,6 +28,10 @@
 #include    "mkind.h"
 #include    "genind.h"
 
+#ifdef HAVE_LOCALE_H
+#include <locale.h>
+#endif
+
 static FIELD_PTR curr = NULL;
 static FIELD_PTR prev = NULL;
 static FIELD_PTR begin = NULL;
@@ -61,6 +65,9 @@
 {
     int     n;
     int     tmp_lc;
+#ifdef HAVE_SETLOCALE
+    char *prev_locale;
+#endif
 
     MESSAGE("Generating output file %s...", ind_fn);
     PUT(preamble);
@@ -68,6 +75,9 @@
     if (init_page)
 	insert_page();
 
+#ifdef HAVE_SETLOCALE
+    prev_locale = setlocale(LC_CTYPE, "");
+#endif
     /* reset counters for putting out dots */
     idx_dc = 0;
     for (n = 0; n < idx_gt; n++) {
@@ -76,6 +86,9 @@
 		IDX_DOT(DOT_MAX);
 	    }
     }
+#ifdef HAVE_SETLOCALE
+    setlocale(LC_CTYPE, prev_locale);
+#endif
     tmp_lc = ind_lc;
     if (in_range) {
 	curr = range_ptr;



More information about the tex-k mailing list