Bug 438109 - strings which begin with '0' are not recognized as octal numbers
Summary: strings which begin with '0' are not recognized as octal numbers
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: tcsh
Version: 5.1
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Vitezslav Crhonek
QA Contact: Bill Huang
URL:
Whiteboard:
Depends On:
Blocks: 391501 409971 878531
TreeView+ depends on / blocked
 
Reported: 2008-03-19 05:27 UTC by Andrew Ryan
Modified: 2018-10-20 01:13 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 616052 878531 (view as bug list)
Environment:
Last Closed: 2009-01-20 20:33:25 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
patch backported from tcsh 6.15.01 (700 bytes, patch)
2008-03-19 05:27 UTC, David Robinson
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2009:0060 0 normal SHIPPED_LIVE tcsh bug fix update 2009-01-20 16:04:02 UTC

Description David Robinson 2008-03-19 05:27:08 UTC
Description of problem:
The man page for tcsh says that strings which begin with '0' are considered
octal numbers, but they aren't actually treated as such by tcsh.

From tcsh(1):
"Strings which begin with ‘0’ are considered octal numbers. Null or missing
arguments are considered ‘0’. The results of all expressions are strings, which
represent decimal numbers. It is important to note that no two components of an
expression can appear in the same word; except when adjacent to components of
expressions which are syntactically significant to the parser (‘&’ ‘|’ ‘<’ ‘>’
‘(’ ‘)’) they should be surrounded by spaces."

Version-Release number of selected component (if applicable):
tcsh-6.14-12.el5
Red Hat Enterprise Linux Server release 5.1 (Tikanga)

How reproducible:
100%

Steps to Reproduce:
1.
$ cat > test.sh << EOF
#! /bin/tcsh
# test 1
@ i = -020
echo $i
# test 2
if (010 * 2 == 16) then
    echo "16"
endif
# test 3
( exit 010 )
echo $?
EOF

2.
$ ./test.sh 

Actual results:
$ ./test.sh 
-20
10

Expected results:
$ ./test.sh 
-16
16
8

Additional info:
Upstream bug: http://bugs.gw.com/view.php?id=54
Backported patch for RHEL 5 is attached.

Comment 1 David Robinson 2008-03-19 05:27:09 UTC
Created attachment 298477 [details]
patch backported from tcsh 6.15.01

Comment 2 RHEL Program Management 2008-06-02 20:13:08 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 8 errata-xmlrpc 2009-01-20 20:33:25 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-0060.html


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