Removed unused check

This commit is contained in:
GrenderG committed 2019-10-21 00:09:07 +02:00
1 parent 0ba68d389e
commit 0156967ea9
1 file changed
+11 -11
+11 -11
View File
@@ -765,7 +765,7 @@ void editorApplySyntaxHighlight() {
void editorSelectSyntaxHighlight() { void editorSelectSyntaxHighlight() {
ec.syntax = NULL; ec.syntax = NULL;
if (ec.file_name == NULL && ec.extension[0] == '\0') if (ec.file_name == NULL)
return; return;
char* ext_name = ec.extension[0] == '\0' ? ec.file_name : ec.extension; char* ext_name = ec.extension[0] == '\0' ? ec.file_name : ec.extension;
@@ -1721,17 +1721,17 @@ int handleArgs(int argc, char* argv[]) {
printf("tte - version %s\n", TTE_VERSION); printf("tte - version %s\n", TTE_VERSION);
return -1; return -1;
} else if (strncmp("-t", argv[1], 2) == 0 || strncmp("--use-tabs", argv[1], 10) == 0) { } else if (strncmp("-t", argv[1], 2) == 0 || strncmp("--use-tabs", argv[1], 10) == 0) {
ec.use_tabs = 1; ec.use_tabs = 1;
return argc > 2 ? 2 : 0; return argc > 2 ? 2 : 0;
} else if (strncmp("-e", argv[1], 2) == 0 || strncmp("--extension", argv[1], 11) == 0) { } else if (strncmp("-e", argv[1], 2) == 0 || strncmp("--extension", argv[1], 11) == 0) {
if (argc > 3) { if (argc > 3) {
size_t len = strlen(argv[2]); size_t len = strlen(argv[2]);
strncpy(ec.extension, argv[2], len); strncpy(ec.extension, argv[2], len);
return 4; return 4;
} else { } else {
printf("[ERROR] You must specify an extension and a file name\n"); printf("[ERROR] You must specify an extension and a file name\n");
return -1; return -1;
} }
} }
} }