diff -ur cjkutils-4.8.2.orig/cjklatex/cjklatex.c cjkutils-4.8.2/cjklatex/cjklatex.c --- cjkutils-4.8.2.orig/cjklatex/cjklatex.c 2010-12-19 16:17:26.000000000 +0100 +++ cjkutils-4.8.2/cjklatex/cjklatex.c 2010-12-19 16:25:43.000000000 +0100 @@ -1,11 +1,15 @@ /* - Purpose: call latex after preprocessing of the .tex file by + Purpose: call LATEX after preprocessing of the .tex file by the cjk conversion tool. The old f_name.bat script is not working anymore. Author : F. Popineau Date : <29/06/2001> */ +#ifndef LATEX +#define LATEX "latex" +#endif + /* Copyright (C) 2001-2008 F. Popineau @@ -40,7 +44,7 @@ static const char *usage_str[] = { "Usage: %s OPTIONS FILE\n", - "Calls `latex' on FILE after conversion by the filter\n", + "Calls `" LATEX "' on FILE after conversion by the filter\n", "specified by OPTIONS.\n", "--conv=bg5\tfor traditional Chinese, encoding Big 5,\n", "--conv=cef\tfor Chinese Encoding Framework, encoding CEF,\n", @@ -50,14 +54,14 @@ "--conv=sjis\tfor Japanese, SJIS encoding.", "\nAlternatively, for compatibility with the previous DOS batch files,\n", "you can also copy this program to any of the following names:\n", - "bg5latex.exe, cef5latex.exe, ceflatex.exe, cefslatex.exe,\n", - "gbklatex.exe and sjislatex.exe .\n", + "bg5" LATEX ".exe, cef5" LATEX ".exe, cef" LATEX ".exe, cefs" LATEX ".exe,\n", + "gbk" LATEX ".exe and sjis" LATEX ".exe .\n", "Then running one of these programs will be identical to specify\n", "the corresponding option.\n", "\nAdditional options:\n", "--verbose\tbe a bit more verbose about what is happening,\n", "--nocleanup\tdo not remove intermediate files,\n", - "--latex=engine\tuse `engine' instead of `latex' to process the file.\n", + "--latex=engine\tuse `engine' instead of `" LATEX "' to process the file.\n", NULL }; @@ -67,13 +71,13 @@ const char *progname; const char *processor; } CJKtable[] = { - { "cjklatex", "" }, - { "bg5latex", "bg5conv" }, - { "ceflatex", "cefconv" }, - { "cef5latex", "cef5conv" }, - { "cefslatex", "cefsconv" }, - { "gbklatex", "extconv" }, - { "sjislatex", "sjisconv" } + { "cjk" LATEX, "" }, + { "bg5" LATEX, "bg5conv" }, + { "cef" LATEX, "cefconv" }, + { "cef5" LATEX, "cef5conv" }, + { "cefs" LATEX, "cefsconv" }, + { "gbk" LATEX, "extconv" }, + { "sjis" LATEX, "sjisconv" } }; #define PROGRAM_IS(p) FILESTRCASEEQ (p, progname) @@ -122,7 +126,7 @@ static void usage(void) { int i; - fprintf(stderr, "CJKlatex version %s\n", cjklatex_version_string); + fprintf(stderr, "CJK" LATEX " version %s\n", cjklatex_version_string); fprintf(stderr,usage_str[0], progname ); fputs("\n", stderr); for(i = 1; usage_str[i]; ++i) @@ -242,7 +246,7 @@ fprintf(stderr, "%s of %s.\n", progname, cjklatex_version_string); exit(0); } - else if (PROGRAM_IS("cjklatex")) { + else if (PROGRAM_IS("cjk" LATEX)) { if (ARGUMENT_IS("conv")) { for (i = 1; i < sizeof(CJKtable)/sizeof(CJKtable[0]) && program_number <= 0; i++) { if (STRNEQ(optarg, CJKtable[i].progname, strlen(optarg))) { @@ -281,7 +285,7 @@ assert(program_number > 0); if (! texengine) { - texengine = xstrdup("latex"); + texengine = xstrdup(LATEX); } do_process(CJKtable[program_number].processor, filename);