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:
authorGonzalo Paniagua Javier <gonzalo.mono@gmail.com>2006-04-07 02:16:48 +0400
committerGonzalo Paniagua Javier <gonzalo.mono@gmail.com>2006-04-07 02:16:48 +0400
commit4b940b084fb6897c9197f99589637dd87c79daa3 (patch)
treea53a2d6f178b29db03b55953b500f1c09083b252 /mcs/class/System/System.IO/FAMWatcher.cs
parentc2fd40763e3590cb3897154efd9d75ff78c0455a (diff)
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. svn path=/trunk/mcs/; revision=59147
Diffstat (limited to 'mcs/class/System/System.IO/FAMWatcher.cs')
-rw-r--r--mcs/class/System/System.IO/FAMWatcher.cs10
1 files changed, 7 insertions, 3 deletions
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;
}