Mercurial > hg > octave-nkf
changeset 6856:b39ecdddd77b
[project @ 2007-09-01 00:49:18 by dbateman]
author | dbateman |
---|---|
date | Sat, 01 Sep 2007 00:49:19 +0000 |
parents | a052825889a0 |
children | 5cc9caab1a31 |
files | src/ChangeLog src/ls-mat-ascii.cc |
diffstat | 2 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2007-08-31 Michael Goffioul <michael.goffioul@gmail.com> + * ls-mat-ascii.cc (get_lines_and_columns): Check beg variable for + NPOS to avoid segmentation fault. + * load-path.cc (load_path::do_find_file): Do not assume paths use forward slashes.
--- a/src/ls-mat-ascii.cc +++ b/src/ls-mat-ascii.cc @@ -151,7 +151,8 @@ { beg = buf.find_first_not_of (", \t", end); - if (buf[beg] == '\r' && beg == buf.length () - 1) + if (beg == NPOS || (buf[beg] == '\r' && + beg == buf.length () - 1)) { // We had a line with trailing spaces and // ending with a CRLF, so this should look like EOL,