Mercurial > hg > octave-lyh
diff scripts/plot/__gnuplot_version__.m @ 8794:f16aafdd99ca
__gnuplot_version__.m: don't use regexp to extract version number
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 18 Feb 2009 01:10:43 -0500 |
parents | 7d6e659acc1a |
children | 7d48766c21a5 |
line wrap: on
line diff
--- a/scripts/plot/__gnuplot_version__.m +++ b/scripts/plot/__gnuplot_version__.m @@ -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__;