# HG changeset patch # User John Tsiombikas # Date 1349143406 -10800 # Node ID 0b130c6e534d6e14562e909311b55a9e83879b34 # Parent 7f52d6310317e6d81ed01c9b838d67f03bca099b whatever diff -r 7f52d6310317 -r 0b130c6e534d prototype/src/dataset.h --- a/prototype/src/dataset.h Tue Oct 02 04:52:59 2012 +0300 +++ b/prototype/src/dataset.h Tue Oct 02 05:03:26 2012 +0300 @@ -47,18 +47,20 @@ return iter->second; } - const char *path, *slash; + const char *fname, *slash; if((slash = strrchr(name, '/'))) { - path = slash + 1; + fname = slash + 1; } else { - path = name; + fname = name; } - if(!(path = datafile_path(path).c_str()) || !*path) { + + std::string path = datafile_path(fname); + if(path.empty()) { fprintf(stderr, "can't find data file: %s\n", name); return 0; } - T res = load(path); + T res = load(path.c_str()); if(res) { data[name] = res; }