diff --git a/src/libs/libgroff/font.cpp b/src/libs/libgroff/font.cpp
index 97017d0b2..923b501c9 100644
--- a/src/libs/libgroff/font.cpp
+++ b/src/libs/libgroff/font.cpp
@@ -22,6 +22,7 @@ along with this program. If not, see . */
#include
#include
#include
+#include
#include
#include "errarg.h"
@@ -746,7 +747,22 @@ again:
}
else {
int i;
+ char *bb = NULL;
+ size_t lc = strlen(pp)-1;
+ if (pp[lc] == 'l') {
+ bb = new char[lc];
+ strncpy(bb, pp, lc);
+ }
for (i = 0; i < num_papersizes; i++) {
+ if (bb && strcasecmp(papersizes[i].name, bb) == 0) {
+ if (length)
+ *length = papersizes[i].width;
+ if (width)
+ *width = papersizes[i].length;
+ if (size)
+ *size = papersizes[i].name;
+ return true;
+ }
if (strcasecmp(papersizes[i].name, pp) == 0) {
if (length)
*length = papersizes[i].length;
@@ -757,6 +773,7 @@ again:
return true;
}
}
+ delete[] bb;
if (attempt_file_open) {
FILE *fp = fopen(p, "r");
if (fp != 0) {