This patch fixes the '-l' option in efix 0.3 which is part of efax 0.9. Without this patch, lines on page 2 and subsequent are missing if the specified number of lines per page is lower than the default (66). diff -Naur efax-0.9-orig/efix.c efax-0.9/efix.c --- efax-0.9-orig/efix.c Tue Mar 2 07:02:47 1999 +++ efax/efix.c Fri Aug 25 00:34:18 2000 @@ -297,6 +297,9 @@ if ( ! err && ! done ) { + if ( pfont ) ifile.font = pfont ; + if ( pglines ) ifile.pglines = pglines ; + if ( nxtoptind < argc ) { ifnames = argv + nxtoptind ; if ( argv [ argc ] ) { @@ -307,9 +310,6 @@ } else { err = msg ( "E3 missing input file name" ) ; } - - if ( pfont ) ifile.font = pfont ; - if ( pglines ) ifile.pglines = pglines ; newIFILE ( &ovfile, ovfnames ) ; --- efax08a/efaxio.c.ewt Thu Dec 1 21:26:31 2016 +++ efax/efaxio.c Thu Dec 1 21:26:31 2016 @@ -2,6 +2,7 @@ #include #include #include +#include #include "efaxio.h" /* EFAX */ #include "efaxmsg.h" --- efax-0.9/efax.c.nullptr Sat Mar 27 09:24:10 1999 +++ efax/efax.c Wed Jan 12 22:17:21 2000 @@ -2186,6 +2186,7 @@ /* print initial message to both stderr & stdout */ argv0 = argv[0] ; + memset((void *)lkfile, 0, sizeof(lkfile)); /* random effects on sparc linux */ verb[1] = "ewia" ; msg ( "I " Version " " Copyright ) ; argv0 = efaxbasename ( argv0 ) ; --- efax-0.9/efaxos.c.nullptr Tue Mar 2 01:18:30 1999 +++ efax/efaxos.c Wed Jan 12 22:16:04 2000 @@ -482,7 +482,7 @@ { int err = 0 ; char **p = lkfiles ; - while ( *p && ! err ) + while ( *p && **p && ! err ) if ( ( err = ttlock ( *p++, log ) ) == 3 ) err = 0 ; return err ; } @@ -495,7 +495,7 @@ { int err = 0, i ; char **p = lkfiles ; - while ( *p ) + while ( *p && **p ) if ( ( i = ttunlock ( *p++ ) ) != 0 ) err = i ; return err ; } --- efax-0.9/fax.orig Mon May 6 17:46:23 2002 +++ efax/fax Mon May 6 17:48:34 2002 @@ -424,7 +424,8 @@ fi case $f in *.[0-9][0-9][0-9]) FILES="$FILES $f" ;; # skip image files - *) if echo ${f}.001: $f \; x | make -r -q -f - ; then +# *) if echo ${f}.001: $f \; x | make -r -q -f - ; then + *) if [ "$f.001" -nt "$f" ]; then echo ${f}.nnn is up-to-date else $RM ${f}.[0-9][0-9][0-9] diff -urN efax-0.9a-001114/PATCHES efax/PATCHES --- efax-0.9a-001114/PATCHES 1970-01-01 03:00:00 +0300 +++ efax/PATCHES 2004-01-03 14:35:45 +0300 @@ -0,0 +1,25 @@ +The standard distribution of efax-0.9a-001114 has a bug in both efax +and efix. They make a call to setlocale(), which causes incorrect +floating point representation in locales which use the comma instead +of the full-stop as the decimal separator. This is corrected in the +versions of efax.c and efix.c in this directory. + +CUPS-1.1.19 and above will not print multi-page PS files produced with +efix correctly. In so doing CUPS is pedantic but correct, as efix +includes an EPS reference in the PS header, and the EPS standard +requires EPS files only to have one page. The PS header in const char +PSBEGIN [] in efax/efaxlib.c in this directory has therefore been +amended so as to exclude the EPS reference. + +A change has been made to the definition of MAXMSGBUF in efaxmsg.c, so +that it does not exceed PIPE_BUF/2 in size. This is so that a message +from efax does not overrun the pipe used to communicate with efax-gtk. + +To distinguish itself from the standard distribution, the binary of +efax is installed as efax-0.9a and the binary of efix is installed as +efix-0.9a. efax-gtk will look for these executables by those names. +If you want to use the standard distribution of efax with efax-gtk, +then make a symbolic link between efax and efax-0.9a, and between efix +and efix-0.9a, and efax-gtk will then find them. + +Chris Vine, January 2004 diff -urN efax-0.9a-001114/efax.c efax/efax.c --- efax-0.9a-001114/efax.c 2000-11-14 20:22:09 +0300 +++ efax/efax.c 2003-05-25 18:10:47 +0400 @@ -26,6 +26,12 @@ */ + /* the call to setlocale(), was omitted by Chris Vine 25 May 2003: + * it causes incorrect floating point representation in locales + * which use the comma instead of the full-stop as the decimal + * separator. Apart from that, efax-0.9a-001114 is unchanged + */ + const char *Usage = "Usage:\n" " %s [ option ]... [ -t num [ file... ] ]\n" @@ -2236,7 +2242,10 @@ msg ( "A compiled "__DATE__ " " __TIME__ ) ; verb[1] = "" ; + /* omit setlocale(), it causes incorrect floating point representatin + * in some locales setlocale ( LC_ALL, "" ) ; + */ while ( ! err && ! doneargs && ( c = nextopt ( argc,argv, diff -urN efax-0.9a-001114/efaxlib.c efax/efaxlib.c --- efax-0.9a-001114/efaxlib.c 2000-02-07 06:11:44 +0300 +++ efax/efaxlib.c 2003-10-18 03:12:40 +0400 @@ -1380,7 +1380,12 @@ */ const char PSBEGIN [] = /* start of file */ +/* This line is commented out, as multi-page files are invalid under + the EPS specification. The text should be marked as PS if it is lawful + to include more than one page "%%!PS-Adobe-2.0 EPSF-2.0 \n" +*/ + "%%!PS-Adobe-2.0 \n" "%%%%Creator: efax (Copyright 1995 Ed Casas) \n" "%%%%Title: efix output\n" "%%%%Pages: (atend) \n" diff -urN efax-0.9a-001114/efaxmsg.c efax/efaxmsg.c --- efax-0.9a-001114/efaxmsg.c 1999-03-20 07:38:20 +0300 +++ efax/efaxmsg.c 2004-01-03 14:27:18 +0300 @@ -4,11 +4,17 @@ #include #include #include +#include #include "efaxmsg.h" #define MAXTSTAMP 80 /* maximum length of a time stamp */ + +#if PIPE_BUF>8192 #define MAXMSGBUF 4096 /* maximum status/error message bytes held */ +#else +#define MAXMSGBUF PIPE_BUF/2 +#endif #define NLOG 2 diff -urN efax-0.9a-001114/efix.c efax/efix.c --- efax-0.9a-001114/efix.c 2000-02-07 01:36:25 +0300 +++ efax/efix.c 2003-05-25 18:10:47 +0400 @@ -26,6 +26,12 @@ */ + /* the call to setlocale(), was omitted by Chris Vine 25 May 2003: + * it causes incorrect floating point representation in locales + * which use the comma instead of the full-stop as the decimal + * separator. Apart from that, efax-0.9a-001114 is unchanged + */ + const char *Usage = "Usage:\n" " %s [ option ]... file... \n" @@ -249,7 +255,10 @@ argv0 = argv[0] ; + /* omit setlocale(), it causes incorrect floating point representatin + * in some locales setlocale ( LC_ALL, "" ) ; + */ /* process arguments */