summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2016-02-25 23:42:50 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2016-02-25 23:42:50 +0000
commit41e276fb01fea9657679a3af5b80672c1ca38576 (patch)
treed22fb7cccd9f1eb10dcd3e87c11cc01c8dfc2a87 /Build
parent3a3f4c713291f6128a880e1e34a79a3c461acb67 (diff)
web2c/mplibdir: sync with the upstream
git-svn-id: svn://tug.org/texlive/trunk@39870 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/web2c/mplibdir/ChangeLog13
-rw-r--r--Build/source/texk/web2c/mplibdir/mpost.w54
2 files changed, 57 insertions, 10 deletions
diff --git a/Build/source/texk/web2c/mplibdir/ChangeLog b/Build/source/texk/web2c/mplibdir/ChangeLog
index ab427c9c227..2aeb31bedab 100644
--- a/Build/source/texk/web2c/mplibdir/ChangeLog
+++ b/Build/source/texk/web2c/mplibdir/ChangeLog
@@ -1,3 +1,7 @@
+2015-12-16 Luigi Scarso <luigi.scarso@gmail.com>
+ Updated to cairo-1.14.6, gmp-6.1.0 and libpng-1.6.20.
+ Fixed some issues with tfm files.
+
2015-11-11 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
* mp.w: Sync with the upstream.
@@ -25,26 +29,25 @@
* mptraptest.test (new): ... into this.
* am/mplib.am: Better dependencies for 'make check'.
-2015-03-21 Luigi Scarso <luigi.scarso@gmail.com>
+2015-03-21 Luigi Scarso <luigi.scarso@gmail.com>
make_text for mplib only.
-2015-03-19 Luigi Scarso <luigi.scarso@gmail.com>
+2015-03-19 Luigi Scarso <luigi.scarso@gmail.com>
Fixed normal rand. generator for double/decimal/binary
systems.
2015-01-20 Luigi Scarso <luigi.scarso@gmail.com>
-
Added cur_sym_mod() == mp_normal_sym
to the cur_sym==0 condition mp_cur_tok
-2015-01-19 Luigi Scarso <luigi.scarso@gmail.com>
+2015-01-19 Luigi Scarso <luigi.scarso@gmail.com>
fixed a bug in mp_recycle_value with NULL node
-2015-01-15 Luigi Scarso <luigi.scarso@gmail.com>
+2015-01-15 Luigi Scarso <luigi.scarso@gmail.com>
mpmathdecimal.w: better management for static data in mpmathdecimal.w
(thanks to Philipp Gesang <phg@phi-gamma.net>)
diff --git a/Build/source/texk/web2c/mplibdir/mpost.w b/Build/source/texk/web2c/mplibdir/mpost.w
index cf87cceab7f..c419cdc25a2 100644
--- a/Build/source/texk/web2c/mplibdir/mpost.w
+++ b/Build/source/texk/web2c/mplibdir/mpost.w
@@ -47,6 +47,8 @@ static char *job_name = NULL;
static char *job_area = NULL;
static int dvitomp_only = 0;
static int ini_version_test = false;
+string output_directory; /* Defaults to NULL. */
+
@<getopt structures@>;
@<Declarations@>;
@@ -538,15 +540,49 @@ static int get_random_seed (void) {
@ @<Register the callback routines@>=
options->random_seed = get_random_seed();
+
+@ Handle -output-directory.
+
+@c
+static char *mpost_find_in_output_directory(const char *s,const char *fmode)
+{
+ if (output_directory && !kpse_absolute_p(s, false)) {
+ char *ftemp = concat3(output_directory, DIR_SEP_STRING, s);
+ return ftemp;
+ }
+ return NULL;
+}
+
+
+
@ @c
static char *mpost_find_file(MP mp, const char *fname, const char *fmode, int ftype) {
size_t l ;
char *s;
+ char *ofname;
(void)mp;
s = NULL;
- if (fname == NULL || (fmode[0]=='r' && !kpse_in_name_ok(fname)) ||
- (fmode[0]=='w' && !kpse_out_name_ok(fname)))
+ ofname = NULL ;
+
+
+ if (fname == NULL || (fmode[0]=='r' && !kpse_in_name_ok(fname)) )
return NULL; /* disallowed filename */
+
+
+ if (fmode[0]=='w') {
+ if (output_directory) {
+ ofname = mpost_find_in_output_directory(fname,fmode);
+ if (ofname == NULL || (fmode[0]=='w' && !kpse_out_name_ok(ofname))) {
+ mpost_xfree(ofname);
+ return NULL; /* disallowed filename */
+ }
+ } else {
+ if (!kpse_out_name_ok(fname))
+ return NULL; /* disallowed filename */
+ }
+ }
+
+
if (fmode[0]=='r') {
if ((job_area != NULL) &&
(ftype>=mp_filetype_text || ftype==mp_filetype_program )) {
@@ -618,8 +654,14 @@ static char *mpost_find_file(MP mp, const char *fname, const char *fmode, int ft
}
}
} else {
- if (fname!=NULL)
- s = mpost_xstrdup(fname); /* when writing */
+ /* when writing */
+ if (ofname) {
+ s = mpost_xstrdup(ofname);
+ mpost_xfree(ofname);
+ } else {
+ s = mpost_xstrdup(fname);
+ }
+
}
return s;
}
@@ -715,6 +757,7 @@ void run_set_list (MP mp) {
}
+
@ @c
static void *mpost_open_file(MP mp, const char *fname, const char *fmode, int ftype) {
char realmode[3];
@@ -879,11 +922,12 @@ static struct option mpost_options[]
}
} else if (ARGUMENT_IS("halt-on-error")) {
options->halt_on_error = true;
+ } else if (ARGUMENT_IS("output-directory")) {
+ output_directory = optarg ;
} else if (ARGUMENT_IS("8bit") ||
ARGUMENT_IS("parse-first-line")) {
/* do nothing, these are always on */
} else if (ARGUMENT_IS("translate-file") ||
- ARGUMENT_IS("output-directory") ||
ARGUMENT_IS("no-parse-first-line")) {
fprintf(stdout,"warning: %s: unimplemented option %s\n", argv[0], argv[optind]);
}