octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MSVC patch: "cd" to root dir


From: Bill Denney
Subject: Re: MSVC patch: "cd" to root dir
Date: Sun, 14 Jan 2007 09:18:14 -0500
User-agent: Thunderbird 1.5.0.9 (Windows/20061207)

If I'm reading this correctly, you're wanting to make

chdir("c:")

change your directory to c:\.  Is that right?

If that is correct, then I don't think that is proper behavior. The way that the dos prompt handles this is that you change to the current directory on that drive, so if you're in c:\octave, and you type "cd d:\temp" you will go directly to the d:\temp directory. If you go back to the c drive by typing "cd c:" you will end up in c:\octave. This is the way that the dos prompt handles it, and I think that we should be consistent with that.

Bill

P.S.  Sorry if my interpretation of the patch was wrong.

Michael Goffioul wrote:
This patch solves a problem under Win32: you can't "cd" to root dir. Indeed,
you need a final backslash for the function "chdir" to succeed.

Michael.

Index: liboctave/lo-sysdep.cc
===================================================================
RCS file: /cvs/octave/liboctave/lo-sysdep.cc,v
retrieving revision 1.11
diff -c -r1.11 lo-sysdep.cc
*** liboctave/lo-sysdep.cc      6 Dec 2006 20:23:18 -0000       1.11
--- liboctave/lo-sysdep.cc      14 Jan 2007 12:13:11 -0000
***************
*** 89,94 ****
--- 89,98 ----

   return retval;
 #else
+ #if defined (__WIN32__)
+   if (path.length() == 2 && path[1] == ':')
+     path += "\\";
+ #endif
   return chdir (path.c_str ());
 #endif
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]