Index: [Article Count Order] [Thread]

Date:  Sun, 21 Nov 1999 12:32:45 +0900
From:  TAGA Nayuta <nayuta@is.s.u-tokyo.ac.jp>
Subject:  [mayu-ml:00007] BUGS
To:  mayu-ml@yl.is.s.u-tokyo.ac.jp
Message-Id:  <19991121123245-12963T.nayuta@harp.is.s.u-tokyo.ac.jp>
X-Mail-Count: 00007

現時点での問題点などの覚え書き。

BUG 1:
	http://www.yl.is.s.u-tokyo.ac.jp/~nayuta/S/mayu/CUSTOMIZE.html#defaultModifier
	の記述間違い。

		> key I-* = 
		> と記述すると、この文以降のデフォルトモディファイヤは 
		> ~C-~M-~S-*NL-*CL-*SL-I- となります。

	ではなく

		> key *I- = 
		> と記述すると、この文以降のデフォルトモディファイヤは 
		> ~C-~M-~S-*NL-*CL-*SL-*I- となります。

	の間違い。

BUG 2:
	正規表現ライブラリに少々バグあり。
	http://codeguru.developer.com/string/regexp.shtml

BUG 3:
	時々フォーカスの追跡に失敗する。特にコマンドプロンプト。

BUG 4:
	標準キーボードドライバ以外を使用していると落ちる。

TODO 1:
	TeraTerm で emacs を使っているときに、反対側のウィンドウをスク
	ロールさせるため、以下の文をデフォルトに入れる。

	keymap TeraTerm
	  key M-PageUp => C-c BackSpace
	  key M-PageDown => C-c Space

REF 1:
	Windows で emacs 的キーバインディングを実現するソフト。
	http://www.shiratori.riec.tohoku.ac.jp/~noguchi/keymacs.html

--
∩∩ | TAGA Nayuta <nayuta@is.s.u-tokyo.ac.jp> 多賀 奈由太
"∪" | Department of Information Science, University of Tokyo

http://codeguru.developer.com/mfc/comments/6688.shtml
Bug in regexp::regexec( )
-------------------------------------------------------------------------------
There is a bug in regexp::regexec() in the for() clause at line 1100
 causing the input string to be overrunned by missing the zero termination.

original:
for ( LPTSTR s = string; s != NULL; s = _tcschr( s+1 , regstart ) )
	if ( executor.regtry( s) ) return true;
return false;

changed to:
for ( LPTSTR s = string; s != NULL; s = _tcschr( s+1 , regstart ) )
{
	if ( executor.regtry( s) ) return true;
	if (*s == 0) return false; 
}
return false;

This seems to correct the problem.

http://codeguru.developer.com/mfc/comments/6659.shtml
substring problems with more than one sub-pattern
-------------------------------------------------------------------------------
Just downloaded the source and compiled it to a DLL. 
I have problem with Substrings. 
Given a pattern "NLSGet(\(\".*\"\))" 
and a string like "this is an nlsGet(\"test\")" everything works fine (re[1] return "test"). 
As soon as there is more than one sub-pattern in my regexp, the substrings returned by the [] operator are all bogus. 
e.g. 
"(NLSGet|NLSGetv)(.*)" 
and re.Match("this is an NLSGet(\"test\")") 
SubStrings returns 2 (OK) 
rgx[1] returns "N" which is wrong (should be "NLSGet" or "NLSGetv"; I debugged operator[] and the length is really 6, but after memcpy only 1 character is in the buffer (more specifically there is a 0x0 in the 2nd position of the buffer). 

I tried lots of things: 
compiling different versions with and without _MBCS, with and without _UNICODE. Without the _MBCS I get link errors; your documentation says MBCS is not supported. 
I couldn't get any of them to work. 

Please help. 
What are the "right" compiler switches? Is there a VC 6 compatible version? 

http://codeguru.developer.com/mfc/comments/6087.shtml
word matching and \0, \1...
-------------------------------------------------------------------------------
Great class. It seems however that the sub-expressions "\0", "\1",
"\2"... do not work with "word mathing" patterns. For instance with
(\<foo\>) as a regular expression, I can specify "&", but not "\0" nor
"\1" in the replace expression. I'm not so familiar with Harry
Spencer's code to find out how to add it, but some comments in your
source seem to confirm this lack. Some hints?  

http://codeguru.developer.com/mfc/comments/6089.shtml
-------------------------------------------------------------------------------
In fact I see that it DOES work if you specify \<(foo)\> instead of
(\<foo\>). This may be a good workaround.

http://codeguru.developer.com/mfc/comments/4831.shtml
-------------------------------------------------------------------------------
Excelent work Guy. Thankyou very much for the super class, and
wrapper, and I don't mind at all that it's using CString etc:)

However, GetErrorString() sometimes does not work... enter "*" as your
regex (clearly invalid), this fails to compile but the calling code
can't see the szError that was correctly set up as it's in a local
object.

// First pass: determine size, legality.
 CRegValidator tester( exp );
 
 if (tester.reg(0, &flags) == NULL)
 {
  regerror(tester.GetErrorString()); 
  return false;
 }

This fix(?) seems to do the trick. The szError in tester is a local
object, and hence cannot be accessed by any calling functionality.