diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2014-01-17 07:18:28 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2014-01-17 07:18:28 +0000 |
commit | cf2d23360ee1162fe86b0d284eae8e67620e309d (patch) | |
tree | fbe235c75e4561f93780f3b5f919c8f35933c718 /Build/source | |
parent | 15bb342337f516b631267a87fddf4d78a2a1a40e (diff) |
psutils: Modified config file format
git-svn-id: svn://tug.org/texlive/trunk@32697 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source')
-rw-r--r-- | Build/source/texk/psutils/ChangeLog | 5 | ||||
-rw-r--r-- | Build/source/texk/psutils/data/paper.cfg | 2 | ||||
-rw-r--r-- | Build/source/texk/psutils/paper-size.c | 14 |
3 files changed, 16 insertions, 5 deletions
diff --git a/Build/source/texk/psutils/ChangeLog b/Build/source/texk/psutils/ChangeLog index f3657931d28..4d9af84cf92 100644 --- a/Build/source/texk/psutils/ChangeLog +++ b/Build/source/texk/psutils/ChangeLog @@ -1,3 +1,8 @@ +2014-01-17 Peter Breitenlohner <peb@mppmu.mpg.de> + + * paper-size.c, data/paper.cfg: Modify and document the config + file format. Close the config file. + 2014-01-16 Peter Breitenlohner <peb@mppmu.mpg.de> Import psutils-1.23. diff --git a/Build/source/texk/psutils/data/paper.cfg b/Build/source/texk/psutils/data/paper.cfg index 35455ecc2d8..daf1447b57d 100644 --- a/Build/source/texk/psutils/data/paper.cfg +++ b/Build/source/texk/psutils/data/paper.cfg @@ -1 +1 @@ -a4 # default papersize +p a4 # default papersize diff --git a/Build/source/texk/psutils/paper-size.c b/Build/source/texk/psutils/paper-size.c index 2a0ed5b3749..0f7dae01ff9 100644 --- a/Build/source/texk/psutils/paper-size.c +++ b/Build/source/texk/psutils/paper-size.c @@ -42,13 +42,19 @@ do_init (void) if (!fp) die ("can't open config file %s", CONFIG_NAME); - while (i < MAX_PAPER - 1 && - (ch = fgetc (fp)) > 0 && ch != ' ' && ch != '\n' && ch != '\r') - default_paper[i++] = ch; + /* In order to specify PAPER as default papersize the config file must + contain 'p PAPER', optionally followed by a space or end of line + and a comment. */ + if (fgetc (fp) == 'p' && fgetc (fp) == ' ') + while (i < MAX_PAPER - 1 && + (ch = fgetc (fp)) > 0 && ch != ' ' && ch != '\n' && ch != '\r') + default_paper[i++] = ch; default_paper[i] = 0; if (i == 0) - die ("can't read default papersize from file %s", CONFIG_NAME); + die ("can't read default papersize from file %s", fqpn); + fclose (fp); + free (fqpn); inited = 1; } |