Bug 194013 - xfig ignores its command line arguments
xfig ignores its command line arguments
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: xfig (Show other bugs)
5
All Linux
medium Severity medium
: ---
: ---
Assigned To: Ngo Than
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-06-04 13:47 EDT by Need Real Name
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-06-07 12:11:42 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Need Real Name 2006-06-04 13:47:22 EDT
Description of problem:
xfig ignores the arguments on the command line


Version-Release number of selected component (if applicable):
xfig-3.2.4-17.2.i386

How reproducible:
try any argument, e.g. xfig -help, xfig does not list help

Steps to Reproduce:
1. % xfig -help 
2.
3.
  
Actual results:
starts xfig window

Expected results:
show print the help

Additional info:
The Reason is that in FC5 (at least xfig-3.2.4-17.2), /usr/bin/xfig is a shell
wrapper which sets env and then calls "exec /usr/bin/xfig.bin" without copying
the command line arguments.

To correct, apply the following patch:

--- /usr/bin/xfig.DIST  2006-02-12 19:59:07.000000000 +0100
+++ /usr/bin/xfig       2006-06-04 19:48:26.000000000 +0200
@@ -1,4 +1,4 @@
 #! /bin/sh
 export XAPPLRESDIR=/usr/share/X11/app-defaults
 export LANG=${LANG%.UTF-8}
-exec /usr/bin/xfig.bin
+exec /usr/bin/xfig.bin "$@"
Comment 1 Need Real Name 2006-06-04 14:13:32 EDT
Sorry, my path is not sufficient, as the binary xfig seems to ignore the
arguments if its name is not xfig (in fc5, the it is xfig.bin)
This is shown by trying xfig -metric: the display is still in inches.

So a full correction is the following
1/ Put the ELF binary in some directory with name xfig, for example
/usr/libexec/xfig
2/ Apply this patch
--- /usr/bin/xfig.DIST  2006-02-12 19:59:07.000000000 +0100
+++ /usr/bin/xfig       2006-06-04 20:11:08.000000000 +0200
@@ -1,4 +1,4 @@
 #! /bin/sh
 export XAPPLRESDIR=/usr/share/X11/app-defaults
 export LANG=${LANG%.UTF-8}
-exec /usr/bin/xfig.bin
+exec /usr/libexec/xfig "$@"

PS : the bug in xfig is explicitely said to be fixed in the source of xfig!
cf. the CHANGE file in source rpm:
o If xfig was renamed to anything else, the command-line arguments and X
resources weren't parsed by the Intrinsics.  This is fixed.
Comment 2 Need Real Name 2006-06-05 07:46:06 EDT
A other solution for the bug is to force the application name in the wrapper,
that is:
1/ leave the ELF binary as /usr/bin/xfig.bin
2/ Apply this patch
--- /usr/bin/xfig.DIST  2006-02-12 19:59:07.000000000 +0100
+++ /usr/bin/xfig       2006-06-05 13:48:20.000000000 +0200
@@ -1,4 +1,5 @@
 #! /bin/sh
 export XAPPLRESDIR=/usr/share/X11/app-defaults
 export LANG=${LANG%.UTF-8}
-exec /usr/bin/xfig.bin
+export RESOURCE_NAME=xfig
+exec /usr/bin/xfig.bin "$@"
Comment 3 Need Real Name 2006-06-05 10:08:28 EDT
I was still trying to correct the binray itself, but it seems complicated, so I
submit a bug report to xfig
I found an other simpler solution as the wrapper is using bash: use the -a
option of exec to force the command name ==>
1/ leave the ELF binary as /usr/bin/xfig.bin
2/ Apply this patch
--- /usr/bin/xfig.DIST  2006-02-12 19:59:07.000000000 +0100
+++ /usr/bin/xfig       2006-06-05 16:14:40.000000000 +0200
@@ -1,4 +1,4 @@
 #! /bin/sh
 export XAPPLRESDIR=/usr/share/X11/app-defaults
 export LANG=${LANG%.UTF-8}
-exec /usr/bin/xfig.bin
+exec -a xfig /usr/bin/xfig.bin "$@"
Comment 4 Ngo Than 2006-06-07 12:11:42 EDT
xfig from rawhide does not use the wrapper anymore. I will build
new xfig for FC5 update soon. Thanks for your report.

Note You need to log in before you can comment on or make changes to this bug.