*BSD News Article 17023


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!sun-barr!sh.wide!wnoc-tyo-news!rena!mon!mon2!isac.co.jp!nobu
From: nobu@psrc.isac.co.jp (Nobuhiro Yasutomi)
Newsgroups: comp.os.386bsd.bugs
Subject: expr parenthesis bug fix
Message-ID: <93Jun11.13468@psrc.isac.co.jp>
Date: 11 Jun 93 12:17:31 GMT
Organization: ISAC,Inc. (International Sekisui AI Corporation) JAPAN
Lines: 31


  There is a little bug in expr. For example,

   % expr \( 1 + 1 \) \* 10

  becomes "Syntax error". Followed patch fix it.

*** /usr/src/bin/expr/expr.y.orig	Wed May 26 16:59:01 1993
--- /usr/src/bin/expr/expr.y	Sat May 29 11:00:48 1993
***************
*** 127,133 ****
  	p = *av++;
  
  	if (strlen (p) == 1) {
! 		if (strchr ("|&=<>+-*/%:", *p))
  			return (*p);
  	} else if (strlen (p) == 2 && p[1] == '=') {
  		switch (*p) {
--- 127,133 ----
  	p = *av++;
  
  	if (strlen (p) == 1) {
! 		if (strchr ("|&=<>+-*/%:()", *p))
  			return (*p);
  	} else if (strlen (p) == 2 && p[1] == '=') {
  		switch (*p) {

---
Nobuhiro Yasutomi
nobu@psrc.isac.co.jp
NIFTY: MGG02210