misc.pl:isbracket() fix/misunderstanding?
Brian Renaud
Thu Jun 8 23:43:24 CEST 1995
The subroutine isbracket checks for matching parentheses. When I pass an expression to isbracket which contains a caret "^", isbracket fails. Assuming that I'm interpreting what isbracket() is supposed to do, the following patch fixes the problem. (The same fix should probably be applied to isbrace().) -Brian *** /ra/ripe181/src/misc.pl Wed Jun 7 13:11:49 1995 --- misc.pl Thu Jun 8 16:34:20 1995 *************** *** 408,414 **** } sub isbracket { local($str) = @_; ! local($BRACKET) = "[^\\(^\\)]*"; while ($str =~ s/$BRACKET\($BRACKET\)$BRACKET//g) {} return 0 if $str =~ /[()]/; return 1; --- 408,414 ---- } sub isbracket { local($str) = @_; ! local($BRACKET) = "[^\\(\\)]*"; while ($str =~ s/$BRACKET\($BRACKET\)$BRACKET//g) {} return 0 if $str =~ /[()]/; return 1; -------- Logged at Mon Jun 12 19:04:53 MET DST 1995 ---------
[ rr-impl Archive ]