Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Dec 2005 18:12:12 GMT
From:      Sokolov Alexey <sokolhacker@mail.ru>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   bin/91101: update: /usr/src/usr.bin/whereis/whereis.c
Message-ID:  <200512301812.jBUICClL050031@www.freebsd.org>
Resent-Message-ID: <200512301820.jBUIK3CQ098374@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         91101
>Category:       bin
>Synopsis:       update: /usr/src/usr.bin/whereis/whereis.c
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Fri Dec 30 18:20:03 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Sokolov Alexey
>Release:        6.0-STABLE
>Organization:
SokolSoft.org.ru
>Environment:
>Description:
The conclusion of a command whereis is not pleasant to me. 
Here an example: 

%whereis 
vim vim:/usr/local/bin/vim/usr/local/man/man1/vim.1.gz/usr/ports/editors/vim 

Well it is not readable! And if the file does not exist, in general messages on a mistake is not printed:

%whereis vim_

Has decided to modify a part of a source code (/usr/src/usr.bin/whereis/whereis.c):

/*begin*/
                if (!opt_q) {
                        /* printf("%s:", name); */
                                printed++;
                        printf ("%s:", name);
                }
                if (bin) {
                        /* if (printed++)
                                putchar(' ');
                        fputs(bin, stdout); */
                        printf ("\n %s", bin);
                }
                if (man) {
                        /* if (printed++)
                                putchar(' ');
                        fputs(man, stdout); */
                        printf ("\n %s", man);
                }
                if (src) {
                        /* if (printed++)
                                putchar(' ');
                        fputs(src, stdout); */
                        printf ("\n %s\n", src);
                }
                if (!printed)
                        putchar('\n');
                /* If files have not been found */
                if ((!bin) && (!man) && (!src))
                        printf (" not found!\n");
/*end*/

Now all is much more pleasant:

%whereis vim
vim:
 /usr/local/bin/vim
 /usr/local/man/man1/vim.1.gz
 /usr/ports/editors/vim

And in case of a mistake:

%whereis vim_
vim_: not found!
>How-To-Repeat:

>Fix:
                if (!opt_q) {
                        /* printf("%s:", name); */
                                printed++;
                        printf ("%s:", name);
                }
                if (bin) {
                        /* if (printed++)
                                putchar(' ');
                        fputs(bin, stdout); */
                        printf ("\n %s", bin);
                }
                if (man) {
                        /* if (printed++)
                                putchar(' ');
                        fputs(man, stdout); */
                        printf ("\n %s", man);
                }
                if (src) {
                        /* if (printed++)
                                putchar(' ');
                        fputs(src, stdout); */
                        printf ("\n %s\n", src);
                }
                if (!printed)
                        putchar('\n');
                /* If files have not been found */
                if ((!bin) && (!man) && (!src))
                        printf (" not found!\n");
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200512301812.jBUICClL050031>