changeset 2316:301f26107fdd octave-forge

Bug fix: octcdf now recovers gracefully after an unkown index specification
author abarth93
date Mon, 05 Jun 2006 16:40:07 +0000
parents 7c1e087734f0
children 49eae56677bc
files main/octcdf/ov-ncvar.cc
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/main/octcdf/ov-ncvar.cc	Mon Jun 05 16:19:04 2006 +0000
+++ b/main/octcdf/ov-ncvar.cc	Mon Jun 05 16:40:07 2006 +0000
@@ -245,6 +245,8 @@
 	octave_value_list key_idx = *idx.begin();
 	std::list<Range> ranges = get_slice(key_idx);
 
+        if (error_state)  return retval;
+ 
 	ov_nc_put_vars(get_ncid(),get_varid(),ranges,get_nctype(),scaledrhs);
 
 	retval = rhs;
@@ -311,6 +313,8 @@
 	octave_value_list key_idx = idx.front();
 	std::list<Range> ranges = get_slice(key_idx);
 
+        if (error_state)  return retval;
+
 	retval = ov_nc_get_vars(get_ncid(),get_varid(),ranges,get_nctype());
 
 	if (autonan()) {
@@ -433,6 +437,7 @@
 	  }
           else {
  	    error("octcdf: unknown index specification: type %s",key_idx(i).type_name().c_str());
+	    return ranges;
 	  }
 	}
     }