Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mcs/class/System/System.IO/ChangeLog5
-rw-r--r--mcs/class/System/System.IO/FAMWatcher.cs10
2 files changed, 12 insertions, 3 deletions
diff --git a/mcs/class/System/System.IO/ChangeLog b/mcs/class/System/System.IO/ChangeLog
index 60916fb8fa0..ae8fffb932f 100644
--- a/mcs/class/System/System.IO/ChangeLog
+++ b/mcs/class/System/System.IO/ChangeLog
@@ -1,3 +1,8 @@
+2006-04-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * FAMWatcher.cs: add new directories to the hashtable after start
+ monitoring them, otherwise the ReqNum is not set. Fixes bug #78029.
+
2006-01-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* FAMWatcher.cs: fix arraylist access when a new directory is added and
diff --git a/mcs/class/System/System.IO/FAMWatcher.cs b/mcs/class/System/System.IO/FAMWatcher.cs
index af86050280b..40973d699d8 100644
--- a/mcs/class/System/System.IO/FAMWatcher.cs
+++ b/mcs/class/System/System.IO/FAMWatcher.cs
@@ -280,11 +280,15 @@ namespace System.IO {
string full = fsw.FullPath;
string datadir = data.Directory;
if (datadir != full) {
- string reldir = datadir.Substring (full.Length + 1);
+ int len = full.Length;
+ int slash = 1;
+ if (len > 1 && full [len - 1] == Path.DirectorySeparatorChar)
+ slash = 0;
+ string reldir = datadir.Substring (full.Length + slash);
datadir = Path.Combine (datadir, filename);
filename = Path.Combine (reldir, filename);
} else {
- datadir = Path.Combine (fsw.FullPath, filename);
+ datadir = Path.Combine (full, filename);
}
if (fa == FileAction.Added && Directory.Exists (datadir)) {
@@ -300,7 +304,6 @@ namespace System.IO {
fd.Enabled = true;
newdirs.Add (fd);
newdirs.Add (data);
- requests [fd.Request.ReqNum] = fd;
}
}
@@ -324,6 +327,7 @@ namespace System.IO {
FAMData newdir = (FAMData) newdirs [n];
FAMData parent = (FAMData) newdirs [n + 1];
StartMonitoringDirectory (newdir);
+ requests [newdir.Request.ReqNum] = newdir;
lock (parent) {
parent.SubDirs [newdir.Directory] = newdir;
}