diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2012-07-30 10:07:58 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2012-07-30 10:07:58 +0000 |
commit | 976a0eabadfa4c8e9599ae3b37442eac22d12b63 (patch) | |
tree | 906f2d2f7a5d0956b0da310db757c66af691d9f9 | |
parent | eb80ce0b494df66ea8b34b0c641714827fcd945e (diff) |
luaTeX: Avoid using asprintf()
git-svn-id: svn://tug.org/texlive/trunk@27245 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Build/source/texk/web2c/Makefile.in | 107 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/ChangeLog | 5 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/am/libluatex.am | 6 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/lua/luainit.w | 15 |
4 files changed, 75 insertions, 58 deletions
diff --git a/Build/source/texk/web2c/Makefile.in b/Build/source/texk/web2c/Makefile.in index 8bef94e7c38..9774bdd5beb 100644 --- a/Build/source/texk/web2c/Makefile.in +++ b/Build/source/texk/web2c/Makefile.in @@ -2494,59 +2494,60 @@ nodist_libluatex_a_SOURCES = dvigen.c dofont.c luafont.c mapfile.c \ postlinebreak.c primitive.c printing.c scanning.c stringpool.c \ texdeffont.c texfileio.c texmath.c texnodes.c textcodes.c \ textoken.c avlstuff.c managed-sa.c utils.c -libluatex_a_SOURCES = luatexdir/luatex.h luatexdir/dvi/dvigen.h \ - luatexdir/font/luatexfont.h luatexdir/font/mapfile.h \ - luatexdir/font/sfnt.h luatexdir/font/texfont.h \ - luatexdir/font/tt_glyf.h luatexdir/font/tt_table.h \ - luatexdir/font/writecff.h luatexdir/font/writettf.h \ - luatexdir/image/epdf.h luatexdir/image/image.h \ - luatexdir/image/pdftoepdf.cc luatexdir/image/pdftoepdf.h \ - luatexdir/image/writeimg.h luatexdir/image/writejbig2.h \ - luatexdir/image/writejpg.h luatexdir/image/writejp2.h \ - luatexdir/image/writepng.h luatexdir/lang/hnjalloc.h \ - luatexdir/lang/hyphen.h luatexdir/lang/texlang.h \ - luatexdir/lua/lcallbacklib.c luatexdir/lua/lfontlib.c \ - luatexdir/lua/limglib.c luatexdir/lua/lepdflib.cc \ - luatexdir/lua/lkpselib.c luatexdir/lua/llanglib.c \ - luatexdir/lua/llualib.c luatexdir/lua/llfslibext.c \ - luatexdir/lua/lnodelib.c luatexdir/lua/loslibext.c \ - luatexdir/lua/liolib.c luatexdir/lua/lpdflib.c \ - luatexdir/lua/lstatslib.c luatexdir/lua/ltexiolib.c \ - luatexdir/lua/ltexlib.c luatexdir/lua/ltokenlib.c \ - luatexdir/lua/luagen.h luatexdir/lua/luatex-api.h \ - luatexdir/pdf/pagetree.h luatexdir/pdf/pdfaction.h \ - luatexdir/pdf/pdfannot.h luatexdir/pdf/pdfcolorstack.h \ - luatexdir/pdf/pdfdest.h luatexdir/pdf/pdffont.h \ - luatexdir/pdf/pdfgen.h luatexdir/pdf/pdfglyph.h \ - luatexdir/pdf/pdfimage.h luatexdir/pdf/pdflink.h \ - luatexdir/pdf/pdflistout.h luatexdir/pdf/pdfliteral.h \ - luatexdir/pdf/pdfluaapi.h luatexdir/pdf/pdfobj.h \ - luatexdir/pdf/pdfoutline.h luatexdir/pdf/pdfpage.h \ - luatexdir/pdf/pdfrule.h luatexdir/pdf/pdfsaverestore.h \ - luatexdir/pdf/pdfsetmatrix.h luatexdir/pdf/pdfshipout.h \ - luatexdir/pdf/pdftables.h luatexdir/pdf/pdfthread.h \ - luatexdir/pdf/pdftypes.h luatexdir/pdf/pdfxform.h \ - luatexdir/luascripts/pdflua.h luatexdir/tex/align.h \ - luatexdir/tex/arithmetic.h luatexdir/tex/buildpage.h \ - luatexdir/tex/commands.h luatexdir/tex/conditional.h \ - luatexdir/tex/directions.h luatexdir/tex/dumpdata.h \ - luatexdir/tex/equivalents.h luatexdir/tex/errors.h \ - luatexdir/tex/expand.h luatexdir/tex/extensions.h \ - luatexdir/tex/filename.h luatexdir/tex/inputstack.h \ - luatexdir/tex/linebreak.h luatexdir/tex/mainbody.h \ - luatexdir/tex/maincontrol.h luatexdir/tex/mathcodes.h \ - luatexdir/tex/memoryword.h luatexdir/tex/mlist.h \ - luatexdir/tex/nesting.h luatexdir/tex/packaging.h \ - luatexdir/tex/postlinebreak.h luatexdir/tex/primitive.h \ - luatexdir/tex/printing.h luatexdir/tex/scanning.h \ - luatexdir/tex/stringpool.h luatexdir/tex/texdeffont.h \ - luatexdir/tex/texfileio.h luatexdir/tex/texmath.h \ - luatexdir/tex/texnodes.h luatexdir/tex/textoken.h \ - luatexdir/tex/textcodes.h luatexdir/utils/avl.c \ - luatexdir/utils/avl.h luatexdir/utils/avlstuff.h \ - luatexdir/utils/managed-sa.h luatexdir/utils/utils.h \ - synctexdir/synctex-common.h synctexdir/synctex-luatex.h \ - synctexdir/synctex.c synctexdir/synctex.h mplibdir/lmplib.c +libluatex_a_SOURCES = luatexdir/luatex.h luatexdir/luatex-common.h \ + luatexdir/dvi/dvigen.h luatexdir/font/luatexfont.h \ + luatexdir/font/mapfile.h luatexdir/font/sfnt.h \ + luatexdir/font/texfont.h luatexdir/font/tt_glyf.h \ + luatexdir/font/tt_table.h luatexdir/font/writecff.h \ + luatexdir/font/writettf.h luatexdir/image/epdf.h \ + luatexdir/image/image.h luatexdir/image/pdftoepdf.cc \ + luatexdir/image/pdftoepdf.h luatexdir/image/writeimg.h \ + luatexdir/image/writejbig2.h luatexdir/image/writejpg.h \ + luatexdir/image/writejp2.h luatexdir/image/writepng.h \ + luatexdir/lang/hnjalloc.h luatexdir/lang/hyphen.h \ + luatexdir/lang/texlang.h luatexdir/lua/lcallbacklib.c \ + luatexdir/lua/lfontlib.c luatexdir/lua/limglib.c \ + luatexdir/lua/lepdflib.cc luatexdir/lua/lkpselib.c \ + luatexdir/lua/llanglib.c luatexdir/lua/llualib.c \ + luatexdir/lua/llfslibext.c luatexdir/lua/lnodelib.c \ + luatexdir/lua/loslibext.c luatexdir/lua/liolib.c \ + luatexdir/lua/lpdflib.c luatexdir/lua/lstatslib.c \ + luatexdir/lua/ltexiolib.c luatexdir/lua/ltexlib.c \ + luatexdir/lua/ltokenlib.c luatexdir/lua/luagen.h \ + luatexdir/lua/luatex-api.h luatexdir/pdf/pagetree.h \ + luatexdir/pdf/pdfaction.h luatexdir/pdf/pdfannot.h \ + luatexdir/pdf/pdfcolorstack.h luatexdir/pdf/pdfdest.h \ + luatexdir/pdf/pdffont.h luatexdir/pdf/pdfgen.h \ + luatexdir/pdf/pdfglyph.h luatexdir/pdf/pdfimage.h \ + luatexdir/pdf/pdflink.h luatexdir/pdf/pdflistout.h \ + luatexdir/pdf/pdfliteral.h luatexdir/pdf/pdfluaapi.h \ + luatexdir/pdf/pdfobj.h luatexdir/pdf/pdfoutline.h \ + luatexdir/pdf/pdfpage.h luatexdir/pdf/pdfrule.h \ + luatexdir/pdf/pdfsaverestore.h luatexdir/pdf/pdfsetmatrix.h \ + luatexdir/pdf/pdfshipout.h luatexdir/pdf/pdftables.h \ + luatexdir/pdf/pdfthread.h luatexdir/pdf/pdftypes.h \ + luatexdir/pdf/pdfxform.h luatexdir/luascripts/pdflua.h \ + luatexdir/tex/align.h luatexdir/tex/arithmetic.h \ + luatexdir/tex/buildpage.h luatexdir/tex/commands.h \ + luatexdir/tex/conditional.h luatexdir/tex/directions.h \ + luatexdir/tex/dumpdata.h luatexdir/tex/equivalents.h \ + luatexdir/tex/errors.h luatexdir/tex/expand.h \ + luatexdir/tex/extensions.h luatexdir/tex/filename.h \ + luatexdir/tex/inputstack.h luatexdir/tex/linebreak.h \ + luatexdir/tex/mainbody.h luatexdir/tex/maincontrol.h \ + luatexdir/tex/mathcodes.h luatexdir/tex/memoryword.h \ + luatexdir/tex/mlist.h luatexdir/tex/nesting.h \ + luatexdir/tex/packaging.h luatexdir/tex/postlinebreak.h \ + luatexdir/tex/primitive.h luatexdir/tex/printing.h \ + luatexdir/tex/scanning.h luatexdir/tex/stringpool.h \ + luatexdir/tex/texdeffont.h luatexdir/tex/texfileio.h \ + luatexdir/tex/texmath.h luatexdir/tex/texnodes.h \ + luatexdir/tex/textoken.h luatexdir/tex/textcodes.h \ + luatexdir/utils/avl.c luatexdir/utils/avl.h \ + luatexdir/utils/avlstuff.h luatexdir/utils/managed-sa.h \ + luatexdir/utils/utils.h synctexdir/synctex-common.h \ + synctexdir/synctex-luatex.h synctexdir/synctex.c \ + synctexdir/synctex.h mplibdir/lmplib.c luatex_dvi_ctangle = CWEBINPUTS=$(srcdir)/luatexdir/dvi $(ctangle) luatex_font_ctangle = CWEBINPUTS=$(srcdir)/luatexdir/font $(ctangle) luatex_image_ctangle = CWEBINPUTS=$(srcdir)/luatexdir/image $(ctangle) diff --git a/Build/source/texk/web2c/luatexdir/ChangeLog b/Build/source/texk/web2c/luatexdir/ChangeLog index a5cdd2c5aa0..751e19bfc16 100644 --- a/Build/source/texk/web2c/luatexdir/ChangeLog +++ b/Build/source/texk/web2c/luatexdir/ChangeLog @@ -1,3 +1,8 @@ +2012-07-28 Peter Breitenlohner <peb@mppmu.mpg.de> + + * lua/luainit.w (lua_initialize): Avoid using asprintf(). + * utils/utils.w (initversionstring): Avoid using asprintf(). + 2012-07-26 Peter Breitenlohner <peb@mppmu.mpg.de> * lua/loslibext.c os_gettimeofday): Use int64_t (from W32TeX). diff --git a/Build/source/texk/web2c/luatexdir/am/libluatex.am b/Build/source/texk/web2c/luatexdir/am/libluatex.am index 6bc4c2a8727..26e6c50d8db 100644 --- a/Build/source/texk/web2c/luatexdir/am/libluatex.am +++ b/Build/source/texk/web2c/luatexdir/am/libluatex.am @@ -1,6 +1,6 @@ ## texk/web2c/luatexdir/am/libluatex.am: Makefile fragment for libluatex. ## -## Copyright (C) 2009-2011 Peter Breitenlohner <tex-live@tug.org> +## Copyright (C) 2009-2012 Peter Breitenlohner <tex-live@tug.org> ## You may freely use, modify and/or distribute this file. ## libluatex @@ -22,7 +22,9 @@ libluatex_web = nodist_libluatex_a_SOURCES = -libluatex_a_SOURCES = luatexdir/luatex.h +libluatex_a_SOURCES = \ + luatexdir/luatex.h \ + luatexdir/luatex-common.h ## from luatexdir/dvi ## diff --git a/Build/source/texk/web2c/luatexdir/lua/luainit.w b/Build/source/texk/web2c/luatexdir/lua/luainit.w index 876b901bd7b..b31b72a218e 100644 --- a/Build/source/texk/web2c/luatexdir/lua/luainit.w +++ b/Build/source/texk/web2c/luatexdir/lua/luainit.w @@ -738,9 +738,18 @@ void lua_initialize(int ac, char **av) argc = ac; argv = av; - if (asprintf(&banner, "This is LuaTeX, Version %s-%d" WEB2CVERSION, - luatex_version_string, luatex_date_info) < 0) { - exit(EXIT_FAILURE); + { + const char *fmt = "This is LuaTeX, Version %s-%s" WEB2CVERSION; + size_t len; + char buf[16]; + + sprintf(buf, "%d", luatex_date_info); + len = strlen(fmt) + strlen(luatex_version_string) + strlen(buf) - 3; + + /* len is just enough, because of the placeholder chars in fmt + that get replaced by the arguments. */ + banner = xmalloc(len); + sprintf(banner, fmt, luatex_version_string, buf); } ptexbanner = banner; |