tcpshow is nice utility allowing to watch application traffic in real time. It uses isprint() and replaces unprintable characters with a dot ('.'). Unfortunately, it does not use setlocale() and cannot show 8-bit national characters even if terminal can. Fix: Add the following patch to the port. It enables tcpshow to understand LC_CTYPE and LC_ALL (in this order). Eugene Grosbein--zUa0lsWFme10EjBXFYYt7pB7G5LOP4s2h9UZp0rCbYeO22Pz Content-Type: text/plain; name="file.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="file.diff" --- tcpshow.c.orig Fri Mar 14 12:00:19 2003 +++ tcpshow.c Fri Mar 14 12:07:07 2003 @@ -205,6 +205,7 @@ #include <unistd.h> #include <stdlib.h> #include <stdio.h> +#include <locale.h> /* Some general defines. */ @@ -1262,6 +1263,15 @@ } +void checklocale(void) { + + char *lc; + + if ((lc = getenv("LC_CTYPE")) != NULL) setlocale(LC_CTYPE,lc); + else if ((lc = getenv("LC_ALL")) != NULL) setlocale(LC_ALL,lc); + + return; +} /****==========------------------------------------------------==========****/ /* */ @@ -1302,6 +1312,8 @@ } else error("Unknown command line flag"); + checklocale(); + if (!cookedFlag) forkTcpdump(argc, argv); elif (argc != 0) How-To-Repeat: Use tcpshow in an environment where traffic contain national characters. All of them are replaced with dots.
Responsible Changed From-To: freebsd-ports-bugs->obrien Over to Maintainer
State Changed From-To: open->closed committed, thanks!