Bug 4345 - netcat: wrong program name in usage text
Summary: netcat: wrong program name in usage text
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: netcat (show other bugs)
Version: unstable
Hardware: all Linux
: P2 minor
Assignee: placeholder@altlinux.org
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-11 15:03 MSD by Pavel S. Khmelinsky
Modified: 2009-05-10 09:32 MSD (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel S. Khmelinsky 2004-06-11 15:03:30 MSD
$ netcat
usage: nc [-46Uhklnrtuvz] [-i interval] [-p source port]
          [-s ip address] [-w timeout] [-X vers] [-x proxy address [:port]]
          [hostname] [port[s...]]

Такая вот постенькая бага, лечится элементарно патчем:
--- nc-3.2/usr.bin/nc/netcat.c.orig     2004-06-11 15:02:06 +0400
+++ nc-3.2/usr.bin/nc/netcat.c  2004-06-11 15:02:13 +0400
@@ -76,6 +76,8 @@
 int family = AF_INET;
 char *portlist[PORT_MAX];
 
+char *progname;
+
 ssize_t        atomicio(ssize_t (*)(), int, void *, size_t);
 void   atelnet(int, unsigned char *, unsigned int);
 void   build_ports(char *);
@@ -103,6 +105,8 @@
        char *proxyhost = "", *proxyport = NULL;
        struct addrinfo proxyhints;
 
+       progname=argv[0];
+
        ret = 1;
        s = 0;
        socksv = 5;
@@ -756,7 +760,7 @@
 void
 usage(int ret)
 {
-       fprintf(stderr, "usage: nc [-46Uhklnrtuvz] [-i interval] [-p source
port]\n");
+       fprintf(stderr, "usage: %s [-46Uhklnrtuvz] [-i interval] [-p source
port]\n", progname);
        fprintf(stderr, "\t  [-s ip address] [-w timeout] [-X vers] [-x proxy
address [:port]]\n");
        fprintf(stderr, "\t  [hostname] [port[s...]]\n");
        if (ret)
Comment 1 Dmitry V. Levin 2004-06-27 04:04:41 MSD
Исправить надо, но не таким патчем.
Comment 2 Dmitry V. Levin 2004-07-02 18:14:41 MSD
Fixed in netcat-3.2-alt2