|
@@ -7,14 +7,14 @@
|
|
|
#include "file_info.h"
|
|
#include "file_info.h"
|
|
|
#include "util.h"
|
|
#include "util.h"
|
|
|
|
|
|
|
|
-extern const char* version;
|
|
|
|
|
|
|
+extern const char* VERSION;
|
|
|
|
|
|
|
|
void handle_version(char** argv, int argc) {
|
|
void handle_version(char** argv, int argc) {
|
|
|
bool match;
|
|
bool match;
|
|
|
for (int i = 0; i < argc; i++) {
|
|
for (int i = 0; i < argc; i++) {
|
|
|
match = strcmp(argv[i], "--version") == 0 || strcmp(argv[i], "-v") == 0;
|
|
match = strcmp(argv[i], "--version") == 0 || strcmp(argv[i], "-v") == 0;
|
|
|
if (match) {
|
|
if (match) {
|
|
|
- printf("Crunner version: %s\n", version);
|
|
|
|
|
|
|
+ printf("Crunner version: %s\n", VERSION);
|
|
|
exit(0);
|
|
exit(0);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -47,6 +47,6 @@ void parse_args(char** argv, int argc, file_info* fi) {
|
|
|
fi->bin_name[strlen(fi->bin_name) - 2] = '\0';
|
|
fi->bin_name[strlen(fi->bin_name) - 2] = '\0';
|
|
|
|
|
|
|
|
strncpy(fi->dest_path, CRUNNER_DIR_PATH, ARR_SIZE(fi->dest_path, char) - 1);
|
|
strncpy(fi->dest_path, CRUNNER_DIR_PATH, ARR_SIZE(fi->dest_path, char) - 1);
|
|
|
- strncat(fi->dest_path, "/", 1);
|
|
|
|
|
|
|
+ strncat(fi->dest_path, "/", 2);
|
|
|
strncat(fi->dest_path, fi->bin_name, ARR_SIZE(fi->dest_path, char) - 1);
|
|
strncat(fi->dest_path, fi->bin_name, ARR_SIZE(fi->dest_path, char) - 1);
|
|
|
}
|
|
}
|