NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/44156: "od -?" prints usage for "hexdump" rather than "od"



The following reply was made to PR bin/44156; it has been noted by GNATS.

From: Aleksej Saushev <asau%inbox.ru@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: bin/44156: "od -?" prints usage for "hexdump" rather than "od"
Date: Sat, 27 Nov 2010 03:42:40 +0300

 --- usr.bin/hexdump/odsyntax.c 9 Feb 2010 14:06:37 -0000       1.26
 +++ usr.bin/hexdump/odsyntax.c 26 Nov 2010 23:02:52 -0000
 @@ -73,6 +73,18 @@
  static void odoffset(int, char ***);
  static void posixtypes(char const *);
  
 +static void od_usage(void);
 +
 +static void
 +od_usage(void)
 +{
 +      (void)fprintf(stderr,
 +"usage: od [-aBbcDdeFfHhIiLlOovXx] [-A base] [-j skip] [-N length]\n"
 +"          [-t type_string] [[+]offset[.][Bb]] [file ...]\n"
 +      );
 +      exit(1);
 +}
 +
  void
  odsyntax(int argc, char ***argvp)
  {
 @@ -176,7 +188,7 @@
                        break;
                case '?':
                default:
 -                      usage();
 +                      od_usage();
                }
  
        if (fshead->nextfs->nextfs == NULL)
 @@ -246,7 +258,7 @@
                                default:
                                        warnx("Bad type-size qualifier '%c'",
                                            *type_string);
 -                                      usage();
 +                                      od_usage();
                                }
                                type_string++;
                        } else if (isdigit((unsigned char)*type_string)) {
 @@ -276,7 +288,7 @@
                                default:
                                        warnx("Bad type-size qualifier '%c'",
                                            *type_string);
 -                                      usage();
 +                                      od_usage();
                                }
                                type_string++;
                        } else if (isdigit((unsigned char)*type_string)) {
 @@ -286,7 +298,7 @@
                                nbytes = 4;
                        break;
                default:
 -                      usage();
 +                      od_usage();
                }
                for (odf = odftab; odf->type != 0; odf++)
                        if (odf->type == type && odf->nbytes == nbytes)
 


Home | Main Index | Thread Index | Old Index