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 15DD0138247 for ; Sun, 17 Nov 2013 10:26:59 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A6FE1E09CD; Sun, 17 Nov 2013 10:26:58 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 45300E09CD for ; Sun, 17 Nov 2013 10:26:58 +0000 (UTC) Received: from flycatcher.gentoo.org (flycatcher.gentoo.org [81.93.255.6]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 5D9B133EEC8 for ; Sun, 17 Nov 2013 10:26:57 +0000 (UTC) Received: by flycatcher.gentoo.org (Postfix, from userid 984) id 68F312004B; Sun, 17 Nov 2013 10:26:53 +0000 (UTC) From: "Fabian Groffen (grobian)" To: gentoo-commits@lists.gentoo.org Reply-To: gentoo-dev@lists.gentoo.org, grobian@gentoo.org Subject: [gentoo-commits] gentoo-projects commit in portage-utils/libq: scandirat.c X-VCS-Repository: gentoo-projects X-VCS-Files: scandirat.c X-VCS-Directories: portage-utils/libq X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Message-Id: <20131117102653.68F312004B@flycatcher.gentoo.org> Date: Sun, 17 Nov 2013 10:26:53 +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: 02ae4785-7ee1-47be-965b-f6a3b4d83311 X-Archives-Hash: 65348ed4c2e1cdbee8e03028972edd0c grobian 13/11/17 10:26:53 Modified: scandirat.c Log: 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. Revision Changes Path 1.7 portage-utils/libq/scandirat.c file : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/libq/scandirat.c?rev=1.7&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/libq/scandirat.c?rev=1.7&content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/libq/scandirat.c?r1=1.6&r2=1.7 Index: scandirat.c =================================================================== RCS file: /var/cvsroot/gentoo-projects/portage-utils/libq/scandirat.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- scandirat.c 29 Sep 2013 10:25:25 -0000 1.6 +++ scandirat.c 17 Nov 2013 10:26:53 -0000 1.7 @@ -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,