Author: toshok
Date: 2005-04-19 17:10:54 -0400 (Tue, 19 Apr 2005)
New Revision: 43299

Modified:
   trunk/debugger/ChangeLog
   trunk/debugger/frontend/Command.cs
Log:
2005-04-19  Chris Toshok  <[EMAIL PROTECTED]>

        * frontend/Command.cs (CdCommand.DoExecute): special handling for
        "." and "..", and use DirectoryInfo to make sure paths exist.
        Fixes bug #73247.



Modified: trunk/debugger/ChangeLog
===================================================================
--- trunk/debugger/ChangeLog    2005-04-19 20:57:29 UTC (rev 43298)
+++ trunk/debugger/ChangeLog    2005-04-19 21:10:54 UTC (rev 43299)
@@ -1,5 +1,11 @@
 2005-04-19  Chris Toshok  <[EMAIL PROTECTED]>
 
+       * frontend/Command.cs (CdCommand.DoExecute): special handling for
+       "." and "..", and use DirectoryInfo to make sure paths exist.
+       Fixes bug #73247.
+
+2005-04-19  Chris Toshok  <[EMAIL PROTECTED]>
+
        * frontend/CL.cs (LineParser.GetCommand): change the way commands
        are parsed so that "_" on the line is assumed to be a command
        (which doesn't exist, of course).  Fixes bug #73244.

Modified: trunk/debugger/frontend/Command.cs
===================================================================
--- trunk/debugger/frontend/Command.cs  2005-04-19 20:57:29 UTC (rev 43298)
+++ trunk/debugger/frontend/Command.cs  2005-04-19 21:10:54 UTC (rev 43299)
@@ -681,9 +681,21 @@
                protected override void DoExecute (ScriptingContext context)
                {
                        try {
-                               Environment.CurrentDirectory = Argument;
+                               string new_dir;
 
-                               context.Interpreter.Options.WorkingDirectory = 
Argument;
+                               if (Argument == "..") {
+                                       new_dir = new DirectoryInfo 
(Environment.CurrentDirectory).Parent.FullName;
+                               }
+                               else if (Argument == ".") {
+                                       new_dir = new DirectoryInfo 
(Environment.CurrentDirectory).FullName;
+                               }
+                               else {
+                                       new_dir = new DirectoryInfo 
(Argument).FullName;                            
+                               }
+
+                               Environment.CurrentDirectory = new_dir;
+                               context.Interpreter.Options.WorkingDirectory = 
new_dir;
+
                                Console.WriteLine ("Working directory {0}.",
                                                   
context.Interpreter.Options.WorkingDirectory);
                        }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to