1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
  
     | 
    
      From: Thomas Loimer <thomas.loimer@tuwien.ac.at>
Date: Tue, 30 Nov 2021 09:20:05 +0100
Origin: upstream, https://sourceforge.net/p/mcj/fig2dev/ci/6fc5918
Bug: https://sourceforge.net/p/mcj/tickets/139/
Subject: Pass output language name to driver, ticket #139
 The output driver is first guessed from the output filename suffix, and the
 output driver is called with the -L option. If the -L option is specified on
 the command line, the output driver is called a second time, overriding the
 first call. In the first call, the language name was not passed to the driver.
 This is now fixed. A regression from commit [b4a152].
--- a/fig2dev/fig2dev.c
+++ b/fig2dev/fig2dev.c
@@ -227,7 +227,7 @@ get_args(int argc, char *argv[])
 						!strcmp(p, drivers[i].alias))) {
 				strcpy(lang, drivers[i].name);
 				dev = drivers[i].dev;
-				dev->option('L', optarg);
+				dev->option('L', drivers[i].name);
 				break;
 			}
 		}
--- a/fig2dev/tests/input.at
+++ b/fig2dev/tests/input.at
@@ -36,26 +36,26 @@ AT_CHECK([fig2dev -Leps - out.eps <$srcd
 ],0)
 AT_CLEANUP
 
-AT_SETUP([Use "-" for stdout])
+AT_SETUP([use "-" for stdout])
 AT_KEYWORDS(diversions)
 AT_CHECK([fig2dev -Leps $srcdir/data/line.fig - >out.eps
 ],0)
 AT_CLEANUP
 
-AT_SETUP([Use "- -" for stdin and stdout])
+AT_SETUP([use "- -" for stdin and stdout])
 AT_KEYWORDS(diversions)
 AT_CHECK([fig2dev -Leps - - <$srcdir/data/line.fig >out.eps
 ],0)
 AT_CLEANUP
 
-AT_SETUP([Guess jpeg output format from output filename])
+AT_SETUP([guess jpeg output format from output filename])
 AT_KEYWORDS(read.c)
 AT_SKIP_IF([NO_GS])
 AT_CHECK([fig2dev $srcdir/data/line.fig line.jpg
 ],0)
 AT_CLEANUP
 
-AT_SETUP([Guess tiff output format from output filename])
+AT_SETUP([guess tiff output format from output filename])
 AT_KEYWORDS(read.c)
 AT_SKIP_IF([NO_GS || \
 	( ! pnmtotiff -version && ! convert -version &&  ! gm version)])
@@ -63,6 +63,12 @@ AT_CHECK([fig2dev $srcdir/data/line.fig
 ],0)
 AT_CLEANUP
 
+AT_SETUP([pass driver name to driver, ticket #139])
+AT_KEYWORDS(fig2dev.c epic)
+AT_CHECK([fig2dev $srcdir/data/line.fig line.eepic
+],0)
+AT_CLEANUP
+
 AT_BANNER([Parse color specifications (test lookup_X_color() in colors.c)])
 
 AT_SETUP([accept correct hexadecimal rgb-values])
 
     |