From eab68e44b5ec90395820eb4822fed1b95b6ad538 Mon Sep 17 00:00:00 2001 From: mananapr Date: Thu, 4 Jun 2020 00:32:37 +0530 Subject: [PATCH] Added code for removing leading newline character for shellscript mime --- cf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cf.c b/cf.c index 63e221a..30fdca6 100644 --- a/cf.c +++ b/cf.c @@ -870,7 +870,8 @@ void openFile(char *filepath) { char mime[50]; getMIME(filepath, mime); - if((strcmp(mime,"text") == 0) || (strcmp(mime, "application/x-shellscript\n") == 0)) + mime[strcspn(mime, "\n")] = 0; + if((strcmp(mime,"text") == 0) || (strcmp(mime, "application/x-shellscript") == 0)) { endwin(); // Block SIGWINCH