[Gridflow-cvs] [svn] commit: r5124 - /trunk/src/classes2.cxx

svn-gridflow at artengine.ca svn-gridflow at artengine.ca
Mon Mar 15 21:58:09 EDT 2010


Author: matju
Date: Mon Mar 15 21:58:08 2010
New Revision: 5124

Log:
[gf/find_file] working properly

Modified:
    trunk/src/classes2.cxx

Modified: trunk/src/classes2.cxx
==============================================================================
--- trunk/src/classes2.cxx (original)
+++ trunk/src/classes2.cxx Mon Mar 15 21:58:08 2010
@@ -1414,12 +1414,18 @@
 	    if (fd>=0) {close(fd); outlet_symbol(outlets[0],symprintf("%s/%s",bof,bofp)); return;}
 	    canvas_makefilename(m,s->s_name,bof,MAXPDSTRING);
 	    fd = open(bof,0,O_RDONLY);
+	    //post("(2) fd=%d for %s",fd,bof);
 	    if (fd>=0) {close(fd); outlet_symbol(outlets[0],gensym(bof)); return;}
-	    string a = string(s->s_name);
-	    string b = gf_find_file(a);
-	    if (a!=b) {outlet_symbol(outlets[0],gensym(a.data())); return;}
+
+	    string b = gf_find_file(string(s->s_name));
+	    fd = open(b.data(),0,O_RDONLY);
+	    //post("(3) fd=%d for %s",fd,b.data());
+	    if (fd>=0) {close(fd); outlet_symbol(outlets[0],gensym(b.data())); return;}
+
 	    fd = open(s->s_name,0,O_RDONLY);
-	    if (fd>=0) {close(fd); outlet_symbol(outlets[0],gensym(bof)); return;}
+	    //post("(4) fd=%d for %s",fd,s->s_name);
+	    if (fd>=0) {close(fd); outlet_symbol(outlets[0],s); return;}
+
 	    outlet_bang(outlets[1]);
 	}
 };



More information about the Gridflow-cvs mailing list