wget: fix error message.
Bad:
wget http://127.0.0.1:81/fgdg/Makefile
Connecting to 127.0.0.1[127.0.0.1]:81
: HTTP/1.0 404 Not Foundror 404 Not Found
Good:
wget http://127.0.0.1:81/fgdg/Makefile
Connecting to 127.0.0.1[127.0.0.1]:81
get: server returned error: HTTP/1.0 404 Not Found
nslookup: fix my mistake
applets: make Bernhard Fischer <rep.nop@aon.at> happy :)
diff --git a/networking/wget.c b/networking/wget.c
index 8850fdf..a4c6289 100644
--- a/networking/wget.c
+++ b/networking/wget.c
@@ -324,8 +324,9 @@
break;
/*FALLTHRU*/
default:
- chomp(buf);
- bb_error_msg_and_die("server returned error %s: %s", s, buf);
+ /* Show first line only and kill any ESC tricks */
+ buf[strcspn(buf, "\n\r\x1b")] = '\0';
+ bb_error_msg_and_die("server returned error: %s", buf);
}
/*
@@ -585,6 +586,8 @@
{
FILE *fp;
+ /* glibc 2.4 seems to try seeking on it - ??! */
+ /* hopefully it understands what ESPIPE means... */
fp = fdopen(xconnect_tcp_v4(s_in), "r+");
if (fp == NULL)
bb_perror_msg_and_die("fdopen");