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
This commit is contained in:
maxcodehack 2020-11-20 16:28:10 +00:00
parent 1d8ab97178
commit 8979c94cbd
2 changed files with 8 additions and 4 deletions

3
programs/other/tte/Makefile Executable file
View File

@ -0,0 +1,3 @@
KTCC = $(abspath /media/maxim/E22406D62406AE1B/KOLIBRI/TCC2/)
tte:
wine $(KTCC)/kos32-tcc.exe tte.c getline.c -lck -o tte

View File

@ -459,8 +459,6 @@ void enableRawMode() {
/// die("Failed to set raw mode"); /// die("Failed to set raw mode");
} }
/// by Siemargl rewritten, still Ctrl+ combination works only in english locale, so need analyze scancode /// by Siemargl rewritten, still Ctrl+ combination works only in english locale, so need analyze scancode
int editorReadKey() { int editorReadKey() {
int key = con_getch2(); int key = con_getch2();
@ -1798,7 +1796,11 @@ int main(int argc, char* argv[]) {
initEditor(); initEditor();
int arg_response = handleArgs(argc, argv); int arg_response = handleArgs(argc, argv);
if (arg_response == 1) { 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]; char* title = argv[1];
strcat(title, " - TinyTextEditor"); strcat(title, " - TinyTextEditor");
con_set_title(title); con_set_title(title);
@ -1812,7 +1814,6 @@ int main(int argc, char* argv[]) {
editorRefreshScreen(); editorRefreshScreen();
editorProcessKeypress(); editorProcessKeypress();
} }
con_exit(1); con_exit(1);
return 0; return 0;
} }