2014-03-04 15:30:11 +00:00
|
|
|
diff -up psutils-1.23/configure.paperconf psutils-1.23/configure
|
|
|
|
--- psutils-1.23/configure.paperconf 2014-01-22 10:31:58.000000000 +0100
|
2015-05-29 11:55:06 +00:00
|
|
|
+++ psutils-1.23/configure 2015-05-20 14:25:40.636115433 +0200
|
2014-03-04 15:30:11 +00:00
|
|
|
@@ -15700,7 +15700,7 @@ fi
|
|
|
|
|
|
|
|
|
|
|
|
if test -z "$PAPER"; then
|
|
|
|
- PAPER=paper
|
|
|
|
+ PAPER=paperconf
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
diff -up psutils-1.23/psutil.c.paperconf psutils-1.23/psutil.c
|
|
|
|
--- psutils-1.23/psutil.c.paperconf 2014-01-16 11:20:54.000000000 +0100
|
2015-05-29 11:55:06 +00:00
|
|
|
+++ psutils-1.23/psutil.c 2015-05-29 13:24:12.834350330 +0200
|
|
|
|
@@ -88,13 +87,21 @@ int paper_size(const char *paper_name, d
|
2014-03-04 15:30:11 +00:00
|
|
|
int res = 0;
|
|
|
|
if (paper_name == NULL) /* Use default paper name */
|
|
|
|
paper_name = pgetline(PAPER);
|
|
|
|
- if (paper_name && (cmd = xasprintf(PAPER " --unit=pt --size %s", paper_name)) && (l = pgetline(cmd)))
|
2015-05-29 11:55:06 +00:00
|
|
|
- res = sscanf(l, "%lg %lg", width, height);
|
2014-03-04 15:30:11 +00:00
|
|
|
+ if (paper_name && (cmd = xasprintf(PAPER " -s %s", paper_name)) && (l = pgetline(cmd)))
|
2015-05-29 11:55:06 +00:00
|
|
|
+ {
|
|
|
|
+ for (int i = 0; i < strlen(l); i++)
|
|
|
|
+ {
|
|
|
|
+ if (l[i] == ',')
|
|
|
|
+ {
|
|
|
|
+ l[i] = '.';
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ res = sscanf(l, "%lg %lg", width, height);
|
|
|
|
+ }
|
2014-03-04 15:30:11 +00:00
|
|
|
free(l);
|
|
|
|
free(cmd);
|
2015-05-29 11:55:06 +00:00
|
|
|
return res == 2;
|
|
|
|
}
|
|
|
|
-
|
|
|
|
/* Make a file seekable, using temporary files if necessary */
|
|
|
|
FILE *seekable(FILE *fp)
|
|
|
|
{
|