This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/12053] New: _NL_PAPER_HEIGHT/WIDTH disobeys LC_PAPER
- From: "bkorb at gnu dot org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 24 Sep 2010 19:41:52 -0000
- Subject: [Bug libc/12053] New: _NL_PAPER_HEIGHT/WIDTH disobeys LC_PAPER
- Reply-to: sourceware-bugzilla at sourceware dot org
You can print on letter sized paper and have
scrambled directory listings, or you can have ASCII ordered listings
but the last three lines of each printed page will appear after the
end of the sheet of paper, but you cannot get what you want --
normal "ls" output and letter sized paper. The cause of the
problem, I've been told, is glibc. If you set the environment
variable LC_PAPER to "letter", you should get letter sized pages.
Here is a sample program:
#include <stdio.h>
#include <locale.h>
#include <langinfo.h>
#define NL_PAPER_GET(x) \
((union { char *string; unsigned int word; })nl_langinfo(x)).word
int main(int argc,char **argv)
{
int w, h;
setlocale (LC_PAPER, "");
w = NL_PAPER_GET (_NL_PAPER_WIDTH);
h = NL_PAPER_GET (_NL_PAPER_HEIGHT);
printf ("height: %d\nwidth: %d\n", h, w);
return 0;
}
printing programs depend upon nl_langinfo(_NL_PAPER_HEIGHT) to
determine the length of a page. LC_PAPER is ignored and LC_ALL=C
is obeyed in this computation. This is completely, totally
outrageously screwed up.
--
Summary: _NL_PAPER_HEIGHT/WIDTH disobeys LC_PAPER
Product: glibc
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: libc
AssignedTo: drepper dot fsp at gmail dot com
ReportedBy: bkorb at gnu dot org
CC: glibc-bugs at sources dot redhat dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=12053
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.