]> git.cworth.org Git - apitrace/blobdiff - cli/cli_diff_state.cpp
Fix crash when using apitrace trim's -o option.
[apitrace] / cli / cli_diff_state.cpp
index 5dd0fbe4897decd52b4a5f5b31989a77d3c47ad6..8536e3235c16b170388ce899ce9c651d29ae5f7c 100644 (file)
@@ -29,9 +29,9 @@
 #include <iostream>
 
 #include "cli.hpp"
-#include "os_path.hpp"
+#include "os_string.hpp"
 #include "os_process.hpp"
-#include "trace_tools.hpp"
+#include "trace_resource.hpp"
 
 static const char *synopsis = "Identify differences between two state dumps.";
 
@@ -50,7 +50,7 @@ command(int argc, char *argv[])
 {
     int i;
 
-    for (i = 0; i < argc; ++i) {
+    for (i = 1; i < argc; ++i) {
         const char *arg = argv[i];
 
         if (arg[0] != '-') {
@@ -81,11 +81,7 @@ command(int argc, char *argv[])
     file1 = argv[i];
     file2 = argv[i+1];
 
-#define CLI_DIFF_STATE_COMMAND "jsondiff.py"
-
-    os::Path command = trace::findFile("scripts/" CLI_DIFF_STATE_COMMAND,
-                 APITRACE_SCRIPTS_INSTALL_DIR "/" CLI_DIFF_STATE_COMMAND,
-                                       true);
+    os::String command = trace::findScript("jsondiff.py");
 
     char *args[5];