--- a2ps-4.13/lib/jobs.c.glibcpaper Sat Jan 15 18:15:07 2000 +++ a2ps-4.13/lib/jobs.c Tue Feb 20 18:44:48 2001 @@ -138,6 +138,7 @@ setlocale (LC_MESSAGES, ""); #endif setlocale (LC_CTYPE, ""); + setlocale (LC_PAPER, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); --- a2ps-4.13/lib/options.c.glibcpaper Tue Aug 31 13:42:41 1999 +++ a2ps-4.13/lib/options.c Tue Feb 20 18:44:48 2001 @@ -54,6 +54,8 @@ #include "argv.h" #include "quotearg.h" #include "filalign.h" +#include +#include #define MAN_LINES 66 /* no lines for a man */ extern char *program_name; @@ -281,7 +283,8 @@ struct opt_optarg *opt_optarg_head = NULL; struct opt_optarg *opt_optarg = NULL; int res; - + unsigned int paper_height=0; + /* Reset optind so that getopt is reinitialized. */ optind = 0; @@ -545,7 +548,14 @@ break; case 'M': /* select a medium */ - xstrcpy (job->medium_request, optarg); + if(strcasecmp("_glibc",optarg)==0){ + paper_height = ((union { char *string; unsigned int word; })nl_langinfo(_NL_PAPER_HEIGHT)).word; + if(paper_height==279) /* US Letter */ + strcpy(optarg,"letter"); + else /* Everyone else */ + strcpy(optarg,"a4"); + } + xstrcpy (job->medium_request, optarg); break; case 'n': /* n copies */ --- a2ps-4.13/src/main.c.glibcpaper Wed Jan 26 19:29:15 2000 +++ a2ps-4.13/src/main.c Tue Feb 20 18:45:18 2001 @@ -945,6 +945,7 @@ setlocale (LC_MESSAGES, ""); #endif setlocale (LC_CTYPE, ""); + setlocale (LC_PAPER, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE);