Bug 119186

Summary: less.csh bombs out if LANG isn't defined
Product: Red Hat Enterprise Linux 3 Reporter: Greg Hudson <ghudson>
Component: lessAssignee: Karsten Hopp <karsten>
Status: CLOSED WONTFIX QA Contact: Mike McLean <mikem>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-03-29 09:23:17 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Greg Hudson 2004-03-26 01:29:23 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6)
Gecko/20040207 Firefox/0.8

Description of problem:
If /etc/sysconfig/i18n does not exist and GDM_LANG is not set,
/etc/profile.d/lang.csh leaves LANG undefined. 
/etc/profile.d/less.csh then fails in:

  if ( $?LC_ALL ) then
    setenv LANGVAR $LC_ALL
  else
    setenv LANGVAR $LANG
  endif

RH9 did not have this problem.


Version-Release number of selected component (if applicable):
less-378-11

How reproducible:
Always

Steps to Reproduce:
1. Remove LANG from the environment
2. Run tcsh


Actual Results:  You see the error message:
  LANG: Undefined variable.
and the user's dotfiles are not evaluated.

Comment 1 Karsten Hopp 2004-03-29 09:23:17 UTC
LANG is always set in Red Hat Linux. Lots of applications will break 
if you remove random environment variables. 
Please set LANG to C (setenv LANG C) if you want to have default 
behaviour. 

Comment 2 Greg Hudson 2004-03-29 10:32:15 UTC
Just as an application should not dump core for lack of an environment
variable, a cshrc fragment should not bomb out for lack of one either.
 Given that it is trivial to fix this bug, correctness alone argues
for a fix rather than an excuse.

(Also, empirically, running without a LANG setting worked fine in RH9,
with the exception of some "man" issues which also applied to LANG=C.
 So it is not true that "lots of applications will break" in this case.)