From d40b5f22a4a3e08624db207b2131966249c0abc9 Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Sun, 1 May 2016 22:18:54 +0200 Subject: [PATCH] Better terminal identification --- src/fterm.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/fterm.cpp b/src/fterm.cpp index 256d5f50..fd46bf83 100644 --- a/src/fterm.cpp +++ b/src/fterm.cpp @@ -280,18 +280,20 @@ void FTerm::identifyTermType() if ( (fp = fopen("/etc/ttytype", "r")) != 0 || (fp = fopen("/etc/ttys", "r")) != 0 ) { - char str[BUFSIZ]; - char *p, *type, *name; + char* p; + char* type; + char* name; + char str[BUFSIZ]; // get term basename - const char *term_basename = strrchr(term_name, '/'); + const char* term_basename = strrchr(term_name, '/'); if ( term_basename == 0 ) term_basename = term_name; else term_basename++; // read and parse the file - while ( fgets(str, sizeof(str) - 1, fp) != 0 ) + while ( fgets(str, sizeof(str)-1, fp) != 0 ) { type = name = 0; // 0 == not found p = str;