windows path update
[hashcat.git] / src / hashcat.c
index 80282e1..49458b8 100644 (file)
@@ -15410,6 +15410,10 @@ int main (int argc, char **argv)
         return -1;
       }
 
+      naive_replace (cpath_real, '\\', '/');
+
+      // not escaping here, windows has quotes
+
       snprintf (build_opts, sizeof (build_opts) - 1, "-I \"%s\"", cpath_real);
 
       myfree (cpath_real);
@@ -15427,14 +15431,12 @@ int main (int argc, char **argv)
         return -1;
       }
 
-      char cpath_escaped[1024] = { 0 };
+      naive_escape (cpath_real, PATH_MAX,  ' ', '\\');
 
-      naive_escape (cpath_real, cpath_escaped, sizeof (cpath_escaped));
+      snprintf (build_opts, sizeof (build_opts) - 1, "-I %s", cpath_real);
 
       myfree (cpath_real);
 
-      snprintf (build_opts, sizeof (build_opts) - 1, "-I %s", cpath_escaped);
-
       #endif
 
       // we don't have sm_* on vendors not NV but it doesn't matter