diff options
author | Jeffrey H. Kingston <jeff@it.usyd.edu.au> | 2010-09-14 20:37:12 +0000 |
---|---|---|
committer | Jeffrey H. Kingston <jeff@it.usyd.edu.au> | 2010-09-14 20:37:12 +0000 |
commit | a9f9ae0efa326dc2edc7f2d92ce270f5fdc15b60 (patch) | |
tree | 3f21ea75ffbd40fcd53bf1609782763af3953002 /z10.c | |
parent | 162643f981292504f375a7f834d408a4a0fa7f46 (diff) | |
download | lout-a9f9ae0efa326dc2edc7f2d92ce270f5fdc15b60.tar.gz |
Lout 3.23.
git-svn-id: http://svn.savannah.nongnu.org/svn/lout/trunk@15 9365b830-b601-4143-9ba8-b4a8e2c3339c
Diffstat (limited to 'z10.c')
-rw-r--r-- | z10.c | 26 |
1 files changed, 9 insertions, 17 deletions
@@ -1,6 +1,6 @@ /*@z10.c:Cross References:CrossInit(), CrossMake()@***************************/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.22) */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.23) */ /* COPYRIGHT (C) 1991, 2000 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@cs.usyd.edu.au) */ @@ -237,31 +237,23 @@ OBJECT GallTargEval(OBJECT sym, FILE_POS *dfpos) /*****************************************************************************/ static OBJECT CrossGenTag(OBJECT x) -{ FULL_CHAR buff[MAX_BUFF], *str1, *str2; +{ FULL_CHAR buff[MAX_BUFF], *file_name; OBJECT sym, res; FILE_NUM fnum; int seq; debug1(DCR, DD, "CrossGenTag( %s )", SymName(actual(x))); sym = actual(x); if( cross_sym(sym) == nilobj ) CrossInit(sym); fnum = file_num(fpos(x)); - str1 = SymName(sym); - str2 = FileName(fnum); + file_name = FileName(fnum); seq = crtab_getnext(sym, fnum, &crossref_tab); debug3(DCR, DDD, "%d = crtab_getnext(%s, %s, S); S =", - seq, SymName(sym), FileName(fnum)); + seq, SymName(sym), FileName(fnum)); ifdebug(DCR, DDD, crtab_debug(crossref_tab, stderr)); - if( StringLength(str1) + StringLength(str2) + 10 >= MAX_BUFF ) - Error(10, 3, "automatically generated tag %s.%s.%d is too long", - FATAL, no_fpos, str1, str2, seq); - /* *** make shorter, little risk - StringCopy(buff, str1); - StringCat(buff, AsciiToFull(".")); - *** */ - StringCopy(buff, StringInt(line_num(fpos(sym)))); - StringCat(buff, AsciiToFull(".")); - StringCat(buff, str2); - StringCat(buff, AsciiToFull(".")); - StringCat(buff, StringInt(seq)); + if( StringLength(file_name) + 20 >= MAX_BUFF ) + Error(10, 3, "automatically generated tag is too long (contains %s)", + FATAL, &fpos(x), file_name); + sprintf( (char *) buff, "%d.%d.%s.%d", + file_num(fpos(sym)), line_num(fpos(sym)), file_name, seq); res = MakeWord(QWORD, buff, &fpos(x)); debug2(DCR, DD, "CrossGenTag( %s ) returning %s", SymName(actual(x)), string(res)); return res; |