# HG changeset patch # User John W. Eaton # Date 1234937443 18000 # Node ID f16aafdd99ca4d75146b9b7f175ae27bc95bec90 # Parent 4c989d52f35ca88632dc86a0ad1ed44a3ad5478d __gnuplot_version__.m: don't use regexp to extract version number diff -r 4c989d52f35c -r f16aafdd99ca scripts/ChangeLog --- a/scripts/ChangeLog Wed Feb 18 01:06:46 2009 -0500 +++ b/scripts/ChangeLog Wed Feb 18 01:10:43 2009 -0500 @@ -1,3 +1,8 @@ +2009-02-18 John W. Eaton + + * plot/__gnuplot_version__.m: Don't use regexp to extract version + number. + 2009-02-18 John W. Eaton * plot/gnuplot_drawnow.m (gnuplot_set_term): diff -r 4c989d52f35c -r f16aafdd99ca scripts/plot/__gnuplot_version__.m --- a/scripts/plot/__gnuplot_version__.m Wed Feb 18 01:06:46 2009 -0500 +++ b/scripts/plot/__gnuplot_version__.m Wed Feb 18 01:10:43 2009 -0500 @@ -35,15 +35,11 @@ ## asking us why plotting fails when gnuplot is not found. error ("you must have gnuplot installed to display graphics; if you have gnuplot installed in a non-standard location, see the 'gnuplot_binary' function\n"); endif - pattern = "^[^\\s]*\\s*([0-9]+\\.[0-9]+)\\s*[^\\s]*\\s*([^\\s]*)"; - [d1, d2, d3, d4, matches] = regexp (output, pattern); - if (iscell (matches) && numel (matches) > 0 && iscellstr (matches{1})) - if (numel (matches{1}) == 2) - __version__ = sprintf ("%s.%s", matches{1}{:}); - else - __version__ = matches{1}{1}; - endif - endif + output = strrep (output, "gnuplot", ""); + output = strrep (output, "patchlevel", "."); + output = strrep (output, "\n", ""); + output = strrep (output, "\r", ""); + __version__ = strrep (output, " ", ""); endif version = __version__;