]> git.tdb.fi Git - libs/datafile.git/blobdiff - source/loader.cpp
Move all exception classes to a common header
[libs/datafile.git] / source / loader.cpp
index e1a0d4abd7bcd80adfa4040c2a9bdf43ffb43ee7..4bc715aff01597c4164f19b206f5a31ae8db87fb 100644 (file)
@@ -1,6 +1,6 @@
 #include <msp/core/raii.h>
 #include <msp/strings/format.h>
-#include "dataerror.h"
+#include "except.h"
 #include "loader.h"
 #include "type.h"
 
@@ -24,7 +24,7 @@ bool signature_match(const string &st_sig, const string &act_sig)
        else if(act_sig.size()==2 && act_sig[1]=='*')
        {
                for(string::const_iterator i=st_sig.begin(); i!=st_sig.end(); ++i)
-                       if(*i!=act_sig[0])
+                       if(!signature_match(*i, act_sig[0]))
                                return false;
 
                return true;
@@ -87,7 +87,7 @@ void Loader::load(Parser &p)
        {
                if(p.peek(0))
                        load_direct(p, 0);
-               else
+               else if(p)  // Peek may have processed an __end, so recheck goodness
                {
                        // Parse in raw mode so we can peek immediately after a mode change
                        Statement st = p.parse(true);