[PATCH] Print '\n' and '\t' in log command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Dave,

Currently the log command does not print '\n' and '\t'. The reason
is that isprint() does not return true for those characters.
This patch adds the isspace() test in order to print these characters
properly.

Michael
---
 kernel.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/kernel.c
+++ b/kernel.c
@@ -4164,7 +4164,7 @@ dump_log_entry(char *logptr, int msg_fla
 	}
 
 	for (i = 0, p = msg; i < text_len; i++, p++)
-		fputc(isprint(*p) ? *p : '.', fp);
+		fputc(isprint(*p) || isspace(*p) ? *p : '.', fp);
 	
 	if (dict_len & (msg_flags & SHOW_LOG_DICT)) {
 		fprintf(fp, "\n");
[PATCH] Print '\n' and '\t' in log command

Currently the log command does not print '\n' and '\t'. The reason
is that isprint() does not return true for those characters.
This patch adds the isspace() test in order to print these characters
properly.
---
 kernel.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/kernel.c
+++ b/kernel.c
@@ -4164,7 +4164,7 @@ dump_log_entry(char *logptr, int msg_fla
 	}
 
 	for (i = 0, p = msg; i < text_len; i++, p++)
-		fputc(isprint(*p) ? *p : '.', fp);
+		fputc(isprint(*p) || isspace(*p) ? *p : '.', fp);
 	
 	if (dict_len & (msg_flags & SHOW_LOG_DICT)) {
 		fprintf(fp, "\n");
--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/crash-utility

[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux