Bug 32180

Summary: doscmd fails to run properly when compiled without X-support but running under X
Product: Base System Reporter: Koen Schreel <k.r.a.m.schreel>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.4-STABLE   
Hardware: Any   
OS: Any   

Description Koen Schreel 2001-11-22 09:00:01 UTC
When doscmd is compiled without X-support (by setting the NO_X 
environment variable), code remains that still sets xmode=1
when running the program under X (i.e. the DISPLAY environment
variable is set in the shell).

Fix: 

The code can be found at line 138 and 139 of 
/usr/src/usr.bin/doscmd/doscmd.c. I see two ways of fixing the
problem:

(1) surround the code by an #ifndef NO_X #endif pair
(2) discard the two lines entirely

Option (2) is my favourite because there is no way of getting 
non-X output with X-support compiled in and running under X (unless 
the DISPLAY variable is unset). This is a big disadvantage when using
doscmd in scripts since in xmode, when the dos program finishes, 
doscmd does not. An alternative would be to include a command line 
option to switch xmode off explicitly.
Comment 1 Thomas Gellekum freebsd_committer freebsd_triage 2001-12-04 12:57:51 UTC
State Changed
From-To: open->closed

Fixed in -current and -stable (I took option 2).