diff options
author | Andreas Scherer <andreas_tex@freenet.de> | 2019-01-20 10:27:10 +0000 |
---|---|---|
committer | Andreas Scherer <andreas_tex@freenet.de> | 2019-01-20 10:27:10 +0000 |
commit | cd02dd87b64bf0845238519c7cf93ebf3d1fde21 (patch) | |
tree | 9f64225c4d8695c847e21a1ad8c540d2f998d41f /Build/source/texk/web2c | |
parent | ab356b2663350b06ab5806790ff65038c331952a (diff) |
Use brace notation for variable expansion.
After clarification of the differences between "$VAR" and "${VAR}" as
arguments for 'kpse_var_expand', we can eliminate the macro variable
that was used to avoid any misspelling. DRY is even better.
Maybe the two extra lines will come handy later. This way the 'cweb-tl'
catalog doesn't have to be touched for re-referencing.
git-svn-id: svn://tug.org/texlive/trunk@49768 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c')
-rw-r--r-- | Build/source/texk/web2c/cwebboot.cin | 10 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebdir/ChangeLog | 4 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebdir/comm-w2c.ch | 8 |
3 files changed, 13 insertions, 9 deletions
diff --git a/Build/source/texk/web2c/cwebboot.cin b/Build/source/texk/web2c/cwebboot.cin index 3b740b1af1d..66cba9d30c4 100644 --- a/Build/source/texk/web2c/cwebboot.cin +++ b/Build/source/texk/web2c/cwebboot.cin @@ -179,8 +179,6 @@ err_print(_("! Include file name too long") ) ;goto restart;} \ #define _(STRING) gettext(STRING) \ -#define TEXMF_LOCALE "$TEXMFLOCALEDIR" \ - #define kpse_find_cweb(name) kpse_find_file(name,kpse_cweb_format,true) \ @@ -473,15 +471,17 @@ kpse_set_program_name(argv[0],"cweb"); #line 73 "cwebdir/comm-w2c.ch" /*89:*/ -#line 1269 "cwebdir/comm-w2c.ch" +#line 1267 "cwebdir/comm-w2c.ch" setlocale(LC_MESSAGES,setlocale(LC_CTYPE,"")); -texmf_locale= kpse_var_expand(TEXMF_LOCALE); +texmf_locale= kpse_var_expand("${TEXMFLOCALEDIR}"); + bindtextdomain("cweb", bindtextdomain("cweb-tl", bindtextdomain("web2c-help", -strcmp(texmf_locale,TEXMF_LOCALE)? +strcmp(texmf_locale,"")? texmf_locale:"/usr/share/locale"))); + free(texmf_locale); textdomain("cweb"); diff --git a/Build/source/texk/web2c/cwebdir/ChangeLog b/Build/source/texk/web2c/cwebdir/ChangeLog index 284cd533b16..bdc4333fb25 100644 --- a/Build/source/texk/web2c/cwebdir/ChangeLog +++ b/Build/source/texk/web2c/cwebdir/ChangeLog @@ -1,3 +1,7 @@ +2019-01-20 Andreas Scherer <https://ascherer.github.io> + + * comm-w2c.ch: Use braced evaluation and save a macro variable. + 2019-01-19 Andreas Scherer <https://ascherer.github.io> * comm-w2c.ch: Extended notes about NLS activation. diff --git a/Build/source/texk/web2c/cwebdir/comm-w2c.ch b/Build/source/texk/web2c/cwebdir/comm-w2c.ch index cd326dd485c..3e116befdae 100644 --- a/Build/source/texk/web2c/cwebdir/comm-w2c.ch +++ b/Build/source/texk/web2c/cwebdir/comm-w2c.ch @@ -1264,16 +1264,16 @@ There are several ways to set |TEXMFLOCALEDIR|: e.g., \.{TEXMFLOCALEDIR=\$TEXMFMAIN/locale}\hfil\break or \.{TEXMFLOCALEDIR.cweb=\$TEXMFMAIN/locale}.\par} -@d TEXMF_LOCALE "$TEXMFLOCALEDIR" - @<Set locale...@>= setlocale(LC_MESSAGES, setlocale(LC_CTYPE, "")); -texmf_locale = kpse_var_expand (TEXMF_LOCALE); +texmf_locale = kpse_var_expand ("${TEXMFLOCALEDIR}"); + bindtextdomain("cweb", bindtextdomain("cweb-tl", bindtextdomain("web2c-help", @| - strcmp(texmf_locale, TEXMF_LOCALE) ? + strcmp(texmf_locale, "") ? texmf_locale : "/usr/share/locale"))); + free(texmf_locale); textdomain("cweb"); /* the majority of |"strings"| come from ``plain \.{CWEB}'' */ @.cweb.mo@> |