Bug#74862: tetex-bin: makeindex does not like DOS line-endings
Thomas Esser <te@dbs.uni-hannover.de> schrieb:
>> here is an other patch for makeindexk. The problem, described in
>
> Where?
Oh, excuse me. I meant to attach it. Here it is - but since then Stefan
Ulrich has proposed to change also scanid.{c,h} (although he said he
didn't know whether this is relevant).
diff -urN makeindexk.orig/mkind.h makeindexk/mkind.h
--- makeindexk.orig/mkind.h Wed Oct 2 14:35:05 2002
+++ makeindexk/mkind.h Sat May 8 12:17:28 2004
@@ -208,6 +208,7 @@
#define TAB '\t'
#define LFD '\n'
+#define CRN '\r'
#define SPC ' '
#define LSQ '['
#define RSQ ']'
diff -urN makeindexk.orig/scanst.c makeindexk/scanst.c
--- makeindexk.orig/scanst.c Sat Jan 24 13:11:26 1998
+++ makeindexk/scanst.c Sat May 8 12:23:07 2004
@@ -294,7 +294,7 @@
spec[0] = TOLOWER(c);
while ((i++ < STRING_MAX) && ((c = GET_CHAR(sty_fp)) != SPC) &&
- (c != TAB) && (c != LFD) && (c != EOF))
+ (c != TAB) && (c != LFD) && (c != CRN) && (c != EOF))
spec[i] = TOLOWER(c);
if (i < STRING_MAX) {
spec[i] = NUL;
@@ -304,7 +304,7 @@
spec);
return (-1);
}
- if (c == LFD)
+ if ((c == LFD) || (c == CRN))
sty_lc++;
return (TRUE);
} else {
@@ -327,6 +327,8 @@
case LFD:
sty_lc++;
+ case CRN:
+ sty_lc++;
case SPC:
case TAB:
break;
@@ -369,6 +371,9 @@
case 'n':
clone[i++] = LFD;
break;
+ case 'r':
+ clone[i++] = CRN;
+ break;
default:
clone[i++] = (char) c;
@@ -376,7 +381,7 @@
}
break;
default:
- if (c == LFD)
+ if ((c == LFD) || (c == CRN))
sty_lc++;
if (i < ARRAY_MAX)
clone[i++] = (char) c;
@@ -421,6 +426,8 @@
return (FALSE);
case LFD:
sty_lc++;
+ case CRN:
+ sty_lc++;
case EOF:
STY_ERROR("No character (premature EOF).\n", "");
return (FALSE);
@@ -460,7 +467,7 @@
int n = 0;
while (str[i] != NUL) {
- if (str[i] == LFD)
+ if ((str[i] == LFD) || (str[i] == CRN))
n++;
i++;
}
--
Frank Küster, Biozentrum der Univ. Basel
Abt. Biophysikalische Chemie
Reply to: