diff options
author | Takuji Tanaka <ttk@t-lab.opal.ne.jp> | 2021-09-19 08:43:57 +0000 |
---|---|---|
committer | Takuji Tanaka <ttk@t-lab.opal.ne.jp> | 2021-09-19 08:43:57 +0000 |
commit | 392722d6043c2ebbecdb215ca953b477b2829d45 (patch) | |
tree | e2871ff00166d93e4890c1a2dfe5f6e5b2e15989 /Build/source/texk/makeindexk/scanid.c | |
parent | 07310d6f9b9d530827e154620141a9c62cac5eda (diff) |
makeindex: improve detection of page number types
git-svn-id: svn://tug.org/texlive/trunk@60547 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/makeindexk/scanid.c')
-rw-r--r-- | Build/source/texk/makeindexk/scanid.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/Build/source/texk/makeindexk/scanid.c b/Build/source/texk/makeindexk/scanid.c index 8076a6be472..aea5272d47e 100644 --- a/Build/source/texk/makeindexk/scanid.c +++ b/Build/source/texk/makeindexk/scanid.c @@ -424,26 +424,28 @@ scan_no(char no[], int npg[], short *count, short *type) if (!scan_arabic(no, npg, count)) return (FALSE); /* simple heuristic to determine if a letter is Roman or Alpha */ - } else if (IS_ROMAN_LOWER(no[0]) && (!IS_COMPOSITOR)) { + } else if (IS_ROMAN_LOWER(no[0]) && strchr(page_prec,ROMAN_LOWER) && + (!strchr(page_prec,ALPHA_LOWER) || (!IS_COMPOSITOR))) { *type = ROML; if (!scan_roman_lower(no, npg, count)) return (FALSE); /* simple heuristic to determine if a letter is Roman or Alpha */ - } else if (IS_ROMAN_UPPER(no[0]) && - ((no[0] == ROMAN_I) || (!IS_COMPOSITOR))) { + } else if (IS_ROMAN_UPPER(no[0]) && strchr(page_prec,ROMAN_UPPER) && + (!strchr(page_prec,ALPHA_UPPER) || (!IS_COMPOSITOR))) { *type = ROMU; if (!scan_roman_upper(no, npg, count)) return (FALSE); - } else if (IS_ALPHA_LOWER(no[0])) { + } else if (IS_ALPHA_LOWER(no[0]) && strchr(page_prec,ALPHA_LOWER)) { *type = ALPL; if (!scan_alpha_lower(no, npg, count)) return (FALSE); - } else if (IS_ALPHA_UPPER(no[0])) { + } else if (IS_ALPHA_UPPER(no[0]) && strchr(page_prec,ALPHA_UPPER)) { *type = ALPU; if (!scan_alpha_upper(no, npg, count)) return (FALSE); } else { - IDX_ERROR1("Illegal page number %s.\n", no); + IDX_ERROR2("Illegal page number %s or page_precedence %s.\n", + no, page_prec); return (FALSE); } return (TRUE); |