NetBSD Problem Report #40477

From www@NetBSD.org  Sun Jan 25 20:23:23 2009
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 773BE63BFFA
	for <gnats-bugs@gnats.netbsd.org>; Sun, 25 Jan 2009 20:23:23 +0000 (UTC)
Message-Id: <20090125202323.2023963BAB8@narn.NetBSD.org>
Date: Sun, 25 Jan 2009 20:23:23 +0000 (UTC)
From: rmh@aybabtu.com
Reply-To: rmh@aybabtu.com
To: gnats-bugs@NetBSD.org
Subject: [PATCH] fix libedit build on Glibc systems not based on Linux
X-Send-Pr-Version: www-1.0

>Number:         40477
>Category:       lib
>Synopsis:       [PATCH] fix libedit build on Glibc systems not based on Linux
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lib-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jan 25 20:25:00 +0000 2009
>Closed-Date:    Mon Feb 02 14:32:46 +0000 2009
>Last-Modified:  Mon Feb 02 14:32:46 +0000 2009
>Originator:     Robert Millan
>Release:        N/A
>Organization:
N/A
>Environment:
>Description:
This patch fixes build of libedit on Glibc systems other than those based on Linux.

Index: lib/libedit/filecomplete.c
===================================================================
RCS file: /cvsroot/src/lib/libedit/filecomplete.c,v
retrieving revision 1.12
diff -u -p -r1.12 filecomplete.c
--- lib/libedit/filecomplete.c  11 Jan 2009 15:00:23 -0000      1.12
+++ lib/libedit/filecomplete.c  25 Jan 2009 20:20:51 -0000
@@ -208,7 +208,7 @@ fn_filename_completion_function(const ch
                /* otherwise, get first entry where first */
                /* filename_len characters are equal      */
                if (entry->d_name[0] == filename[0]
-#if defined(__SVR4) || defined(__linux__)
+#if defined(__SVR4) || defined(__linux__) || defined(__GLIBC__)
                    && strlen(entry->d_name) >= filename_len
 #else
                    && entry->d_namlen >= filename_len
@@ -220,7 +220,7 @@ fn_filename_completion_function(const ch

        if (entry) {            /* match found */

-#if defined(__SVR4) || defined(__linux__)
+#if defined(__SVR4) || defined(__linux__) || defined(__GLIBC__)
                len = strlen(entry->d_name);
 #else
                len = entry->d_namlen;

>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:
From: Alan Barrett <apb@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/40477 CVS commit: src/lib/libedit
Date: Mon, 26 Jan 2009 17:32:41 +0000 (UTC)

 Module Name:	src
 Committed By:	apb
 Date:		Mon Jan 26 17:32:41 UTC 2009

 Modified Files:
 	src/lib/libedit: config.h filecomplete.c

 Log Message:
 Define HAVE_STRUCT_DIRENT_D_NAMLEN in config,h, and test it when
 deciding whether to use entry->d_namlen or strlen(entry->d_name).
 Addresses PR 40477 by Robert Millan.


 To generate a diff of this commit:
 cvs rdiff -r1.1 -r1.2 src/lib/libedit/config.h
 cvs rdiff -r1.12 -r1.13 src/lib/libedit/filecomplete.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Alan Barrett <apb@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: lib/40477: [PATCH] fix libedit build on Glibc systems not
	based on Linux
Date: Mon, 26 Jan 2009 19:35:59 +0200

 On Sun, 25 Jan 2009, rmh@aybabtu.com wrote:
 > This patch fixes build of libedit on Glibc systems other than those
 > based on Linux.

 Thank you for the report and patch.  I have tried to fix this in a
 different way; please update to filecomplete.c revision 1.13, and ensure
 that HAVE_STRUCT_DIRENT_D_NAMLEN is not defined in config.h.

 --apb (Alan Barrett)

From: Robert Millan <rmh@aybabtu.com>
To: gnats-bugs@NetBSD.org
Cc: lib-bug-people@netbsd.org, gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org
Subject: Re: lib/40477: [PATCH] fix libedit build on Glibc systems not based on Linux
Date: Mon, 26 Jan 2009 21:53:24 +0100

 On Mon, Jan 26, 2009 at 05:40:05PM +0000, Alan Barrett wrote:
 > The following reply was made to PR lib/40477; it has been noted by GNATS.
 > 
 > From: Alan Barrett <apb@netbsd.org>
 > To: gnats-bugs@netbsd.org
 > Cc: 
 > Subject: Re: lib/40477: [PATCH] fix libedit build on Glibc systems not
 > 	based on Linux
 > Date: Mon, 26 Jan 2009 19:35:59 +0200
 > 
 >  On Sun, 25 Jan 2009, rmh@aybabtu.com wrote:
 >  > This patch fixes build of libedit on Glibc systems other than those
 >  > based on Linux.
 >  
 >  Thank you for the report and patch.  I have tried to fix this in a
 >  different way; please update to filecomplete.c revision 1.13, and ensure
 >  that HAVE_STRUCT_DIRENT_D_NAMLEN is not defined in config.h.

 Fair enough.  Thanks

 -- 
 Robert Millan

   The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
   how) you may access your data; but nobody's threatening your freedom: we
   still allow you to remove your data and not access it at all."

State-Changed-From-To: open->closed
State-Changed-By: apb@NetBSD.org
State-Changed-When: Mon, 02 Feb 2009 14:32:46 +0000
State-Changed-Why:
The problem has been addressed by ading a new #define in config.h.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.