From 6ea79204e51221dcc9e656a0a1703c39c20a6acf Mon Sep 17 00:00:00 2001 From: chris <> Date: Fri, 25 Oct 2002 11:36:02 +0000 Subject: [PATCH] "" --- Makefile | 1 + README | 5 +++-- ui.c | 21 +++++++++++++++------ 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 350a7d1..5599d9b 100644 --- a/Makefile +++ b/Makefile @@ -43,6 +43,7 @@ CFLAGS += -DUSE_GETHOSTBYADDR_R # Uncomment if you are using libresolv. # #LDLIBS += -lresolv # or /usr/lib/libresolv.a on Linux? + # # Uncomment if you are using ares. # diff --git a/README b/README index e761a2b..f5c2118 100644 --- a/README +++ b/README @@ -20,5 +20,6 @@ in order to compile iftop. FreeBSD 4.7: -DNS resolution does not work due to the lack of a proper gethostbyaddr_r -implementation. +This version of FreeBSD lacks a proper gethostbyaddr_r function. You should +choose an alternative name resolution technique; see comments in the Makefile. +We recommend using ares (-DUSE_ARES). diff --git a/ui.c b/ui.c index 2948a79..0422cde 100644 --- a/ui.c +++ b/ui.c @@ -209,6 +209,8 @@ static void draw_bar_scale(int* y) { int i; if(options.showbars) { /* Draw bar graph scale on top of the window. */ + move(*y, 0); + clrtoeol(); mvhline(*y + 1, 0, 0, COLS); for (i = 1; i <= scale[rateidx].max; i *= scale[rateidx].interval) { char s[40], *p; @@ -773,17 +775,19 @@ void ui_loop() { dontshowdisplay = 1; if ((s = edline(0, "Net filter", options.filtercode))) { char *m; + if (s[strspn(s, " \t")] == 0) { + /* Empty filter; set to NULL. */ + xfree(s); + s = NULL; + } if (!(m = set_filter_code(s))) { xfree(options.filtercode); options.filtercode = s; /* -lpcap will write junk to stderr; we do our best to * erase it.... */ - touchline(stdscr, 0, 2); - move(0, 0); - clrtoeol(); - move(1, 0); - clrtoeol(); - refresh(); + move(COLS - 1, LINES - 1); + wrefresh(curscr); + showhelp("Installed new filter"); } else { showhelp(m); xfree(s); @@ -828,7 +832,12 @@ void ui_loop() { xfree(s); } dontshowdisplay = 0; + break; } + case KEY_CLEAR: + case 12: /* ^L */ + wrefresh(curscr); + break; case ERR: break; default: