1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
$NetBSD: patch-aa,v 1.1 2004/08/09 20:14:21 jlam Exp $
--- util.c.orig Mon Jun 7 17:27:49 2004
+++ util.c
@@ -331,11 +331,13 @@ _ds_prepare_path_for (const char *filena
file_buffer_start = file;
path[0] = 0;
+ if (file[0] == '/')
+ strlcat (path, "/", sizeof (path));
dir = strsep (&file, "/");
+
while (dir != NULL)
{
strlcat (path, dir, sizeof (path));
- strlcat (path, "/", sizeof (path));
dir = strsep (&file, "/");
if (dir != NULL && stat (path, &s))
@@ -350,6 +352,8 @@ _ds_prepare_path_for (const char *filena
return EFILE;
}
}
+ if (dir != NULL)
+ strlcat (path, "/", sizeof (path));
}
free (file_buffer_start);
return 0;
|