Mercurial > hg > octave-lyh
diff liboctave/file-ops.cc @ 4577:233512ebf15d
[project @ 2003-10-31 06:31:14 by jwe]
author | jwe |
---|---|
date | Fri, 31 Oct 2003 06:31:21 +0000 |
parents | ea537559ab07 |
children | 88ef6f3701d2 |
line wrap: on
line diff
--- a/liboctave/file-ops.cc +++ b/liboctave/file-ops.cc @@ -182,7 +182,14 @@ int status = -1; #if defined (HAVE_SYMLINK) - status = ::symlink (old_name.c_str (), new_name.c_str ()); + + OCTAVE_LOCAL_BUFFER (char, old_nm, old_name.length ()); + OCTAVE_LOCAL_BUFFER (char, new_nm, new_name.length ()); + + strcpy (old_nm, old_name.c_str ()); + strcpy (new_nm, new_name.c_str ()); + + status = ::symlink (old_nm, new_nm); if (status < 0) { @@ -216,7 +223,11 @@ #if defined (HAVE_READLINK) char buf[MAXPATHLEN+1]; - status = ::readlink (path.c_str (), buf, MAXPATHLEN); + OCTAVE_LOCAL_BUFFER (char, p, path.length ()); + + strcpy (p, path.c_str ()); + + status = ::readlink (p, buf, MAXPATHLEN); if (status < 0) {