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

Michael Holzheu holzheu at linux.vnet.ibm.com
Thu Oct 25 16:34:49 UTC 2012


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");
-------------- next part --------------
A non-text attachment was scrubbed...
Name: crash-6.1.0-dmesg-format.patch
Type: text/x-patch
Size: 634 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/crash-utility/attachments/20121025/36921084/attachment.bin>


More information about the Crash-utility mailing list