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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
--- vtdata/directory.cpp.orig Wed Nov 11 04:06:16 1998
+++ vtdata/directory.cpp Fri Apr 27 20:22:21 2001
@@ -17,7 +17,7 @@
// --------------------------------------------------------------------------
-#include "boost/directory.h"
+#include "directory.h"
#if defined(unix) || defined(__unix) || defined(__unix__)
# define BOOST_UNIX 1
@@ -58,7 +58,7 @@
operator++ ();
}
- ~representation() { closedir(m_handle); }
+ ~representation() { if (m_handle) closedir(m_handle); }
representation *reference()
{
@@ -175,6 +175,8 @@
throw unknown_uid(it.rep->get_stat().st_uid);
return pw->pw_name;
}
+#ifdef BUGGY_CODE
+ // See directory.h for details
template <> void set<uname>(dir_it const &it, std::string name)
{
struct passwd *pw = getpwnam(name.c_str());
@@ -183,6 +185,7 @@
else
throw unknown_uname(name);
}
+#endif
template <> gid_t get<gid>(dir_it const &it) { return it.rep->get_stat().st_gid; }
template <> void set<gid>(dir_it const &it, gid_t gid) { it.rep->change_group(gid); }
@@ -193,6 +196,8 @@
throw unknown_gid(it.rep->get_stat().st_gid);
return grp->gr_name;
}
+#ifdef BUGGY_CODE
+ // See directory.h for details
template <> void set<gname>(dir_it const &it, std::string name)
{
struct group *grp = getgrnam(name.c_str());
@@ -201,7 +206,7 @@
else
throw unknown_gname(name);
}
-
+#endif
template <> bool get<is_hidden>(dir_it const &it) { return (*it)[0] == '.'; }
}
|