From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id AB1401391ED for ; Sat, 8 Mar 2014 05:51:26 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D251AE0AFA; Sat, 8 Mar 2014 05:51:19 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 23A33E0AFA for ; Sat, 8 Mar 2014 05:51:19 +0000 (UTC) Received: from spoonbill.gentoo.org (spoonbill.gentoo.org [81.93.255.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 5409433FAAC for ; Sat, 8 Mar 2014 05:51:18 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id A7DAE188ED for ; Sat, 8 Mar 2014 05:51:15 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1384684013.39d9c93836e5017794ebeaa763e5f243c4f5daf8.vapier@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: libq/ X-VCS-Repository: proj/portage-utils X-VCS-Files: libq/scandirat.c X-VCS-Directories: libq/ X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: 39d9c93836e5017794ebeaa763e5f243c4f5daf8 X-VCS-Branch: master Date: Sat, 8 Mar 2014 05:51:15 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 87dd20c1-44d3-4876-b3d5-491ce02f7d1d X-Archives-Hash: a6ee0f5a8ccbeaec248cc6aa27c91b39 commit: 39d9c93836e5017794ebeaa763e5f243c4f5daf8 Author: Fabian Groffen gentoo org> AuthorDate: Sun Nov 17 10:26:53 2013 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Sun Nov 17 10:26:53 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=39d9c938 scandirat: copy enough bytes to get the filename Solaris is a platform without d_reclen. sizeof(struct dirent) is not enough to get the whole of d_name contents, since the struct uses char[1] as workaround to specify a variable size length end of struct member. --- libq/scandirat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libq/scandirat.c b/libq/scandirat.c index cd7f272..76a5d4a 100644 --- a/libq/scandirat.c +++ b/libq/scandirat.c @@ -1,7 +1,7 @@ /* * Copyright 2005-2011 Gentoo Foundation * Distributed under the terms of the GNU General Public License v2 - * $Header: /var/cvsroot/gentoo-projects/portage-utils/libq/scandirat.c,v 1.6 2013/09/29 10:25:25 vapier Exp $ + * $Header: /var/cvsroot/gentoo-projects/portage-utils/libq/scandirat.c,v 1.7 2013/11/17 10:26:53 grobian Exp $ * * Copyright 2005-2010 Ned Ludd - * Copyright 2005-2011 Mike Frysinger - @@ -18,7 +18,7 @@ #if defined(_DIRENT_HAVE_D_RECLEN) # define reclen(de) ((de)->d_reclen) #else -# define reclen(de) (sizeof(*(de))) +# define reclen(de) (sizeof(*(de)) + strlen((de)->d_name)) #endif static int scandirat(int dir_fd, const char *dir, struct dirent ***dirlist,