summaryrefslogtreecommitdiff
path: root/mysys/my_lib.c
diff options
context:
space:
mode:
authorunknown <aivanov@mysql.com>2005-10-19 18:01:23 +0400
committerunknown <aivanov@mysql.com>2005-10-19 18:01:23 +0400
commitb59d565605269db0a1b39da5e2aa7b686c8ca87a (patch)
tree3c831af5af10c808cb63daefe41f58495ff5c5ef /mysys/my_lib.c
parent94a83fe2953903505d2d16b6d27e61b9e686fcc4 (diff)
downloadmariadb-git-b59d565605269db0a1b39da5e2aa7b686c8ca87a.tar.gz
Fix for BUG#4375: Windows specific directories are copied
during replication. Modified my_dir(). Now this function skips hidden and system files which sometimes are created by Windows. NOTE. The fix is similar to the previuos one (05 July 2004) except for correct setting of the 'attrib' variable value (within the previous fix this variable was left uninitialized when my_dir() was called with My_flags & MY_WANT_STAT == 0). mysys/my_lib.c: Modified my_dir(). Now this function skips hidden and system files which sometimes are created by Windows.
Diffstat (limited to 'mysys/my_lib.c')
-rw-r--r--mysys/my_lib.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/mysys/my_lib.c b/mysys/my_lib.c
index c3b0b57e549..1908c70f407 100644
--- a/mysys/my_lib.c
+++ b/mysys/my_lib.c
@@ -427,6 +427,18 @@ MY_DIR *my_dir(const char *path, myf MyFlags)
do
{
#ifdef __BORLANDC__
+ attrib= find.ff_attrib;
+#else
+ attrib= find.attrib;
+ /*
+ Do not show hidden and system files which Windows sometimes create.
+ Note. Because Borland's findfirst() is called with the third
+ argument = 0 hidden/system files are excluded from the search.
+ */
+ if (attrib & (_A_HIDDEN | _A_SYSTEM))
+ continue;
+#endif
+#ifdef __BORLANDC__
if (!(finfo.name= strdup_root(names_storage, find.ff_name)))
goto error;
#else
@@ -442,11 +454,10 @@ MY_DIR *my_dir(const char *path, myf MyFlags)
bzero(finfo.mystat, sizeof(MY_STAT));
#ifdef __BORLANDC__
finfo.mystat->st_size=find.ff_fsize;
- mode=MY_S_IREAD; attrib=find.ff_attrib;
#else
finfo.mystat->st_size=find.size;
- mode=MY_S_IREAD; attrib=find.attrib;
#endif
+ mode=MY_S_IREAD;
if (!(attrib & _A_RDONLY))
mode|=MY_S_IWRITE;
if (attrib & _A_SUBDIR)