xcore / xcommon

Common application framework for XMOS software
Other
23 stars 7 forks source link

auto_proj: Incorrect error on failed XML file load #11

Closed stevekerrison closed 12 years ago

stevekerrison commented 12 years ago

If the specified XML file is missing or fails to load, auto_proj emits the wrong argument (0 instead of 1). Diff to follow...

stevekerrison commented 12 years ago

Here's a fix:

--- a/auto_proj/src/auto_proj.cpp
+++ b/auto_proj/src/auto_proj.cpp
@@ -130,7 +130,7 @@ int main(int argc, char *argv[]) {
   bool loadOkay = project.LoadFile();

   if (!loadOkay) {
-    std::cerr << "Cannot load XML file `" << argv[0] << "'" << std::endl;
+    std::cerr << "Cannot load XML file `" << argv[1] << "'" << std::endl;
     std::cerr << project.ErrorDesc() << std::endl;
     exit(1);
   }
ghost commented 12 years ago

Done. Though you could have done a pull request for this: http://help.github.com/send-pull-requests/

stevekerrison commented 12 years ago

Thanks. I wasn't sure forking was worth it for a one line patch.