From: Paul K. <pki...@us...> - 2005-03-01 16:38:46
|
Update of /cvsroot/octave/octave-forge/main/strings In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9218 Modified Files: pcregexp.cc Makefile Log Message: Make sure pcregexp compiles and passes the tests Index: Makefile =================================================================== RCS file: /cvsroot/octave/octave-forge/main/strings/Makefile,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile 1 Mar 2005 12:39:29 -0000 1.5 +++ Makefile 1 Mar 2005 16:38:21 -0000 1.6 @@ -2,7 +2,7 @@ PROGS=regexp.oct ifeq ($(HAVE_PCRE),yes) - PROGS:=$PROGS pcregexp.oct + PROGS:=$(PROGS) pcregexp.oct endif all: $(PROGS) Index: pcregexp.cc =================================================================== RCS file: /cvsroot/octave/octave-forge/main/strings/pcregexp.cc,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- pcregexp.cc 1 Mar 2005 04:30:57 -0000 1.1 +++ pcregexp.cc 1 Mar 2005 16:38:21 -0000 1.2 @@ -66,10 +66,8 @@ int matches = pcre_exec(re, NULL, input.c_str(), input.length(), 0, 0, ovector, (subpatterns+1)*3); if (matches == PCRE_ERROR_NOMATCH) { - retval = octave_value_list(Matrix()); - for (int i = 1; i < nargout; i++) { - retval(i) = ""; - } + for (int i=nargout-1; i>=0; i--) retval(i) = ""; + retval(0) = Matrix(); pcre_free(re); return retval; } else if (matches < -1) { |