diff options
author | Marco d'Itri <md@linux.it> | 2005-09-11 16:04:48 +0200 |
---|---|---|
committer | Marco d'Itri <md@linux.it> | 2013-03-30 02:31:32 +0100 |
commit | 9ad7ad696c3bfd7086b453ee07305ceedeeb0a4e (patch) | |
tree | 19a4fc0b06c12acbbc22923fbc52404173c98e2f /whois.c | |
parent | 8d33311a6803e9d3f0ab8509c8bae686f2ff2d2f (diff) | |
download | whois-4.7.7.tar.gz |
Imported Debian version 4.7.7v4.7.7
Diffstat (limited to 'whois.c')
-rw-r--r-- | whois.c | 26 |
1 files changed, 13 insertions, 13 deletions
@@ -491,20 +491,20 @@ int hide_line(int *hiding, const char *const line) } return 0; /* don't hide this line */ } else if (*hiding > HIDE_UNSTARTED) { /* hiding something */ - if (strncmp(line, hide_strings[*hiding + 1], - strlen(hide_strings[*hiding + 1])) == 0) { - *hiding = HIDE_DISABLED; /* stop hiding */ - return 1; /* but hide the last line */ + if (*hide_strings[*hiding + 1] == '\0') { /*look for a blank line?*/ + if (*line == '\n' || *line == '\r' || *line == '\0') { + *hiding = HIDE_DISABLED; /* stop hiding */ + return 0; /* but do not hide the blank line */ + } + } else { /*look for a matching string*/ + if (strncmp(line, hide_strings[*hiding + 1], + strlen(hide_strings[*hiding + 1])) == 0) { + *hiding = HIDE_DISABLED; /* stop hiding */ + return 1; /* but hide the last line */ + } } return 1; /* we are hiding, so do it */ - } -#if 0 - /* XXX */ - /* no match, the action depends on the state stored in *hiding */ - if (*hiding > HIDE_UNSTARTED) - return 1; - else -#endif + } else return 0; } @@ -519,7 +519,7 @@ const char *do_query(const int sock, const char *query) fi = fdopen(sock, "r"); if (write(sock, query, strlen(query)) < 0) err_sys("write"); -/* Using shutdown breaks the buggy RIPE server. +/* Using shutdown used to break the buggy RIPE server. Would this work now? if (shutdown(sock, 1) < 0) err_sys("shutdown"); */ |