less -f

Chuck Swiger cswiger at mac.com
Wed Dec 29 18:16:43 PST 2004


Joshua Lokken wrote:
> On Wed, 29 Dec 2004 20:09:27 -0500, Chuck Swiger <cswiger at mac.com> wrote:
[ ... ]
>>You're right, the manpage says and what the program actually does contradict
>>each other.  Consider the following change to /usr/src/contrib/less:
>>
>>--- filename.c~ Thu Jun 29 21:03:08 2000
>>+++ filename.c  Wed Dec 29 20:04:06 2004
>>@@ -954,10 +954,14 @@
>>        {
>>                static char is_dir[] = " is a directory";
>>
>>-               m = (char *) ecalloc(strlen(filename) + sizeof(is_dir),
>>-                       sizeof(char));
>>-               strcpy(m, filename);
>>-               strcat(m, is_dir);
>>+                if (force_open) {
>>+                    m = NULL;
>>+                } else {
>>+                    m = (char *) ecalloc(strlen(filename) + sizeof(is_dir),
>>+                                         sizeof(char));
>>+                    strcpy(m, filename);
>>+                    strcat(m, is_dir);
>>+                }
>>        } else
>>        {
> 
> Is this something that warrants a send-pr?  I've never used the 
> tool, and don't want to generate needless problem reports.
> What's the best way to handle it?  Thanks for any advice.

I have forwarded your problem description and the patch on to 
<bug-less at gnu.org>, so it can be considered by the author of less.

It might be reasonable to send-pr this as well, if you would like to see 
FreeBSD adopt the fix in a shorter timeframe.

-- 
-Chuck



More information about the freebsd-chat mailing list