Complain and exit if the given shader file doesn't exist.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 16 Jun 2010 19:10:55 +0000 (12:10 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 21 Jun 2010 18:27:33 +0000 (11:27 -0700)
main.cpp

index a6d6c47..b8b99bf 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -218,6 +218,10 @@ main(int argc, char **argv)
         usage_fail(argv[0]);
 
       shader->Source = load_text_file(argv[optind], &shader->SourceLen);
+      if (shader->Source == NULL) {
+        printf("File \"%s\" does not exist.\n", argv[optind]);
+        exit(EXIT_FAILURE);
+      }
 
       compile_shader(shader);