[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
MSVC patch: "cd" to root dir
From: |
John W. Eaton |
Subject: |
MSVC patch: "cd" to root dir |
Date: |
Wed, 17 Jan 2007 16:55:37 -0500 |
On 14-Jan-2007, 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
| }
I checked in this change, but with
if defined (__WIN32__) && ! defined (__CYGWIN__)
because I think cd ("C:") should not be special on a Cygwin system.
Thanks,
jwe