From 8979c94cbd57d97f973187e4199205b5015cc9d8 Mon Sep 17 00:00:00 2001 From: maxcodehack Date: Fri, 20 Nov 2020 16:28:10 +0000 Subject: [PATCH] Fix "Systax highlighting does not work if the extension is in upper case." in TinyTextEditor git-svn-id: svn://kolibrios.org@8225 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/other/tte/Makefile | 3 +++ programs/other/tte/tte.c | 9 +++++---- 2 files changed, 8 insertions(+), 4 deletions(-) create mode 100755 programs/other/tte/Makefile diff --git a/programs/other/tte/Makefile b/programs/other/tte/Makefile new file mode 100755 index 0000000000..f0f7056d3c --- /dev/null +++ b/programs/other/tte/Makefile @@ -0,0 +1,3 @@ +KTCC = $(abspath /media/maxim/E22406D62406AE1B/KOLIBRI/TCC2/) +tte: + wine $(KTCC)/kos32-tcc.exe tte.c getline.c -lck -o tte diff --git a/programs/other/tte/tte.c b/programs/other/tte/tte.c index 35d31c5ea4..77d89f9e3a 100644 --- a/programs/other/tte/tte.c +++ b/programs/other/tte/tte.c @@ -459,8 +459,6 @@ void enableRawMode() { /// die("Failed to set raw mode"); } - - /// by Siemargl rewritten, still Ctrl+ combination works only in english locale, so need analyze scancode int editorReadKey() { int key = con_getch2(); @@ -1798,7 +1796,11 @@ int main(int argc, char* argv[]) { initEditor(); int arg_response = handleArgs(argc, argv); if (arg_response == 1) { - editorOpen(argv[1]); + char* filename = argv[1]; + // tolower + for (int i = 0; i < strlen(filename); i++) filename[i] = tolower(filename[i]); + + editorOpen(filename); char* title = argv[1]; strcat(title, " - TinyTextEditor"); con_set_title(title); @@ -1812,7 +1814,6 @@ int main(int argc, char* argv[]) { editorRefreshScreen(); editorProcessKeypress(); } - con_exit(1); return 0; }