5643b5ee30
strlen(entr->d_name). Thus use this instead of the non-portable d_namlen field.
26 lines
686 B
Text
26 lines
686 B
Text
$NetBSD: patch-ag,v 1.5 2007/01/07 23:53:24 cbiere Exp $
|
|
|
|
--- src/main.cc.orig 2003-09-09 21:22:55.000000000 +0000
|
|
+++ src/main.cc
|
|
@@ -51,10 +51,10 @@
|
|
#include <pth.h>
|
|
#endif
|
|
#include NCURSES
|
|
-#ifdef HAVE_GETOPT_H
|
|
+#ifdef HAVE_GETOPT_LONG_ONLY
|
|
#include <getopt.h>
|
|
#else
|
|
-#include "getopt.h"
|
|
+#include "../getopt/getopt.h"
|
|
#endif
|
|
#ifdef HAVE_ERRNO_H
|
|
#include <errno.h>
|
|
@@ -2917,7 +2917,7 @@ recsel_files(const char *path, char ***f
|
|
while ( (entry = readdir(dir)) )
|
|
{
|
|
DIR *dir2 = NULL;
|
|
- char *newpath = (char *)malloc((entry->d_reclen + 2 + strlen(path)) *
|
|
+ char *newpath = (char *)malloc((strlen(entry->d_name) + 2 + strlen(path)) *
|
|
sizeof(char));
|
|
|
|
PTH_YIELD;
|