Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 314108 Details for
Bug 458833
[patch] libpaper defaults are suboptimal. Patch to fallback through LC_PAPER.
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch to implement
libpaper-useglibcfallback.patch (text/plain), 2.20 KB, created by
Caolan McNamara
on 2008-08-12 15:48:26 UTC
(
hide
)
Description:
patch to implement
Filename:
MIME Type:
Creator:
Caolan McNamara
Created:
2008-08-12 15:48:26 UTC
Size:
2.20 KB
patch
obsolete
>diff -ru libpaper-1.1.23.orig/lib/paper.c libpaper-1.1.23/lib/paper.c >--- libpaper-1.1.23.orig/lib/paper.c 2008-08-12 13:20:48.000000000 +0100 >+++ libpaper-1.1.23/lib/paper.c 2008-08-12 14:26:44.000000000 +0100 >@@ -22,6 +22,9 @@ > > #include <stdlib.h> > >+#include <locale.h> >+#include <langinfo.h> >+ > #include "paper.h" > > struct paper { >@@ -110,6 +113,27 @@ > } > > const char* defaultpapername(void) { >+#if defined(LC_PAPER) && defined(_GNU_SOURCE) >+ >+#define NL_PAPER_GET(x) \ >+ ((union { char *string; unsigned int word; })nl_langinfo(x)).word >+ >+#define PT_TO_MM(v) (unsigned int)((v * 2.54 * 10 / 72) + 0.5) >+ >+ const struct paper* pp; >+ >+ unsigned int w = NL_PAPER_GET(_NL_PAPER_WIDTH); >+ unsigned int h = NL_PAPER_GET(_NL_PAPER_HEIGHT); >+ >+ for (pp = paperfirst(); pp; pp = papernext(pp)) { >+ if ( >+ PT_TO_MM(pp->pswidth) == w && >+ PT_TO_MM(pp->psheight) == h >+ ) { >+ return pp->name; >+ } >+ } >+#endif > return PAPERSIZE; > } > >diff -ru libpaper-1.1.23.orig/man/paperconf.1.in libpaper-1.1.23/man/paperconf.1.in >--- libpaper-1.1.23.orig/man/paperconf.1.in 2008-08-12 13:20:48.000000000 +0100 >+++ libpaper-1.1.23/man/paperconf.1.in 2008-08-12 14:34:06.000000000 +0100 >@@ -48,10 +48,12 @@ > .B @PAPERSIZEVAR@ > environment variable, at the contents of the file specified by the > .B @PAPERCONFVAR@ >-environment variable, at the contects of >+environment variable, at the contents of the file > .B @PAPERCONF@ >-or by using >-.B letter >+, consulting the values controlled by the >+.B LC_PAPER >+locale setting, or by using >+.B @PAPERSIZE@ > as a fall-back value if none of the other alternatives are successful. > By default, width and height of the paper are printed in PostScript points. > .SH OPTIONS >diff -ru libpaper-1.1.23.orig/src/paperconf.c libpaper-1.1.23/src/paperconf.c >--- libpaper-1.1.23.orig/src/paperconf.c 2008-08-12 13:20:48.000000000 +0100 >+++ libpaper-1.1.23/src/paperconf.c 2008-08-12 14:13:33.000000000 +0100 >@@ -13,6 +13,7 @@ > #include <errno.h> > > #include <paper.h> >+#include <locale.h> > > > /* needed for GNU/Hurd */ >@@ -99,6 +100,8 @@ > > const char* progname; > >+ setlocale(LC_ALL, ""); >+ > progname = strrchr(*argv, '/'); > if (progname) { > ++progname;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 458833
: 314108