Mercurial > hg > octave-terminal
changeset 4470:e606bf485c1c
[project @ 2003-07-28 18:05:23 by jwe]
author | jwe |
---|---|
date | Mon, 28 Jul 2003 18:05:23 +0000 |
parents | 53ee020af847 |
children | 6a1e6e87f143 |
files | src/ChangeLog src/sysdep.cc |
diffstat | 2 files changed, 21 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2003-07-28 Paul Kienzle <pkienzle@users.sf.net> + + * sysdep.cc (CYGWIN_init): Convert TMPDIR to system agnostic path. + 2003-07-25 Paul Kienzle <pkienzle@users.sf.net> * help.cc (try_info, display_help_text):
--- a/src/sysdep.cc +++ b/src/sysdep.cc @@ -111,16 +111,29 @@ static void CYGWIN_init (void) { + // Make sure TMPDIR contains an absolute windows path. Use '/' + // rather than '\\' so that sh expansion won't mess file names. + std::string tmpdir = octave_env::getenv ("TMPDIR"); if (tmpdir.empty ()) - { - char buf [PATH_MAX]; + tmpdir = "/tmp"; + + char buf [PATH_MAX]; - cygwin32_conv_to_win32_path ("/tmp", buf); + if (cygwin32_conv_to_full_win32_path (tmpdir.c_str (), buf) < 0) + panic ("CYGWIN_init: unable to convert TMPDIR (= \"%s\") to Windows directory name", + tmpdir.c_str ()); + else + { + tmpdir = buf; - octave_env::putenv ("TMPDIR", buf); + for (size_t i = 0; i < tmpdir.length (); i++) + if (tmpdir[i] == '\\') + tmpdir[i] = '/'; } + + octave_env::putenv ("TMPDIR", tmpdir); } #endif