Commit Diff


commit - abd55be479e44d41048b64aabe7204a1f771038d
commit + 159ecb97c7787c21d28467dfee69c0022098498e
blob - 9c8bd4d25f744c526e3fecc3586cc3c3cadaf8c0
blob + 7b942d1d67157bf45a6160e1b31ae1a115c12a51
--- main.c
+++ main.c
@@ -75,6 +75,13 @@ int main (int argc, char *argv[])
 		return usage ();
 	}
 
+	file = parse ();
+
+	if (file == NULL) {
+		puts ("parsing failed");
+		return 1;
+	}
+
 	if (hdrpath != NULL) {
 		hdr = fopen (hdrpath, "w");
 		if (hdr == NULL)
@@ -87,13 +94,6 @@ int main (int argc, char *argv[])
 			err (1, "cannot open '%s'", srcpath);
 	}
 
-	file = parse ();
-
-	if (file == NULL) {
-		puts ("parsing failed");
-		return 1;
-	}
-
 	gen (file, hdrpath, hdr, src, from, to);
 
 	return 0;