1 --- a2ps-4.15.4/liba2ps/jobs.c.orig 2023-06-11 19:59:27.481861785 +0200
2 +++ a2ps-4.15.4/liba2ps/jobs.c 2023-06-11 19:59:52.208394496 +0200
3 @@ -119,6 +119,7 @@ a2ps_job_new (void)
4 setlocale (LC_TIME, "");
5 setlocale (LC_MESSAGES, "");
6 setlocale (LC_CTYPE, "");
7 + setlocale (LC_PAPER, "");
9 bindtextdomain (PACKAGE, LOCALEDIR);
10 bindtextdomain (PACKAGE "-gnulib", LOCALEDIR);
11 --- a2ps-4.15.4/liba2ps/options.c.orig 2023-04-12 20:50:51.000000000 +0200
12 +++ a2ps-4.15.4/liba2ps/options.c 2023-06-11 20:00:19.368247359 +0200
15 /************************************************************************/
18 +#include <langinfo.h>
22 @@ -267,7 +269,8 @@ a2ps_handle_options (a2ps_job * job, int
23 struct opt_optarg *opt_optarg_head = NULL;
24 struct opt_optarg *opt_optarg = NULL;
27 + unsigned int paper_height=0;
29 /* Reset optind so that getopt is reinitialized. */
32 @@ -515,7 +518,14 @@ a2ps_handle_options (a2ps_job * job, int
35 case 'M': /* select a medium */
36 - xstrcpy (job->medium_request, optarg);
37 + if(strcasecmp("_glibc",optarg)==0){
38 + paper_height = ((union { char *string; unsigned int word; })nl_langinfo(_NL_PAPER_HEIGHT)).word;
39 + if(paper_height==279) /* US Letter */
40 + strcpy(optarg,"letter");
41 + else /* Everyone else */
42 + strcpy(optarg,"a4");
44 + xstrcpy (job->medium_request, optarg);
47 case 'n': /* n copies */
48 --- a2ps-4.15.4/src/main.c.orig 2023-06-11 20:00:41.568127092 +0200
49 +++ a2ps-4.15.4/src/main.c 2023-06-11 20:01:05.021333368 +0200
50 @@ -926,6 +926,7 @@ main (int argc, char *argv[])
51 setlocale (LC_TIME, "");
52 setlocale (LC_MESSAGES, "");
53 setlocale (LC_CTYPE, "");
54 + setlocale (LC_PAPER, "");
56 bindtextdomain (PACKAGE, LOCALEDIR);
57 bindtextdomain (PACKAGE "-gnulib", LOCALEDIR);