NetBSD-Bugs archive

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

Re: bin/46408: Inconsistent handling of hyphens by apropos(1)



On Fri, May 4, 2012 at 3:25 PM, Thomas Klausner <wiz%netbsd.org@localhost> 
wrote:
> The following reply was made to PR bin/46408; it has been noted by GNATS.
>
> From: Thomas Klausner <wiz%NetBSD.org@localhost>
> To: gnats-bugs%NetBSD.org@localhost
> Cc:
> Subject: Re: bin/46408: Inconsistent handling of hyphens by apropos(1)
> Date: Fri, 4 May 2012 11:53:14 +0200
>
>  On Fri, May 04, 2012 at 08:35:00AM +0000, 
> er.abhinav.upadhyay%gmail.com@localhost wrote:
>  > Index: makemandb.c
>  > ===================================================================
>  > RCS file: /cvsroot/src/usr.sbin/makemandb/makemandb.c,v
>  > retrieving revision 1.7
>  > diff -u -p -r1.7 makemandb.c
>  > --- makemandb.c 2 Mar 2012 15:09:58 -0000       1.7
>  > +++ makemandb.c 4 May 2012 08:18:29 -0000
>  > @@ -1270,7 +1270,7 @@ pman_sh(const struct man_node *n, mandb_
>  >                 int has_alias = 0;      // Any more aliases left?
>  >                 while (*name_desc) {
>  >                         /* Remove any leading spaces. */
>  > -                       if (name_desc[0] == ' ') {
>  > +                       if (name_desc[0] == ' ' || name_desc[0] =='-') {
>  >                                 name_desc++;
>  >                                 continue;
>  >                         }
>  >
>
>  The patch has whitespace problems. Also, can you please update the comment 
> directly above?
>
>  Thanks,
>  Thomas
>

Index: makemandb.c
===================================================================
RCS file: /cvsroot/src/usr.sbin/makemandb/makemandb.c,v
retrieving revision 1.7
diff -u -p -r1.7 makemandb.c
--- makemandb.c 2 Mar 2012 15:09:58 -0000       1.7
+++ makemandb.c 4 May 2012 10:05:19 -0000
@@ -1269,8 +1269,8 @@ pman_sh(const struct man_node *n, mandb_
                 */
                int has_alias = 0;      // Any more aliases left?
                while (*name_desc) {
-                       /* Remove any leading spaces. */
-                       if (name_desc[0] == ' ') {
+                       /* Remove any leading spaces or hyphens. */
+                       if (name_desc[0] == ' ' || name_desc[0] =='-') {
                                name_desc++;
                                continue;
                        }


Home | Main Index | Thread Index | Old Index