1 |
vapier 11/12/22 18:29:23 |
2 |
|
3 |
Modified: scandirat.c |
4 |
Log: |
5 |
since sizeof(dirent) is not portable (and will break on some systems), use the d_reclen member instead ... it still isnt entirely portable, but at least it works when it is available |
6 |
|
7 |
Revision Changes Path |
8 |
1.3 portage-utils/libq/scandirat.c |
9 |
|
10 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/libq/scandirat.c?rev=1.3&view=markup |
11 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/libq/scandirat.c?rev=1.3&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/libq/scandirat.c?r1=1.2&r2=1.3 |
13 |
|
14 |
Index: scandirat.c |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo-projects/portage-utils/libq/scandirat.c,v |
17 |
retrieving revision 1.2 |
18 |
retrieving revision 1.3 |
19 |
diff -u -r1.2 -r1.3 |
20 |
--- scandirat.c 18 Dec 2011 06:31:29 -0000 1.2 |
21 |
+++ scandirat.c 22 Dec 2011 18:29:23 -0000 1.3 |
22 |
@@ -1,7 +1,7 @@ |
23 |
/* |
24 |
* Copyright 2005-2011 Gentoo Foundation |
25 |
* Distributed under the terms of the GNU General Public License v2 |
26 |
- * $Header: /var/cvsroot/gentoo-projects/portage-utils/libq/scandirat.c,v 1.2 2011/12/18 06:31:29 vapier Exp $ |
27 |
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/libq/scandirat.c,v 1.3 2011/12/22 18:29:23 vapier Exp $ |
28 |
* |
29 |
* Copyright 2005-2010 Ned Ludd - <solar@g.o> |
30 |
* Copyright 2005-2011 Mike Frysinger - <vapier@g.o> |
31 |
@@ -31,7 +31,7 @@ |
32 |
continue; |
33 |
|
34 |
ret = realloc(ret, sizeof(*ret) * (cnt + 1)); |
35 |
- ret[cnt++] = xmemdup(de, sizeof(*de)); |
36 |
+ ret[cnt++] = xmemdup(de, de->d_reclen); |
37 |
} |
38 |
*dirlist = ret; |