diff options
author | Roland McGrath <roland@gnu.org> | 2002-10-19 20:11:14 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 2002-10-19 20:11:14 +0000 |
commit | ad4339ac357de846308adca5098f06a1652b23fb (patch) | |
tree | 845ea4e3a31e4459054a5c814984733d9c4f7a95 | |
parent | 640a0f3be271822009b9110295c1ef61f90c8053 (diff) |
2002-10-19 Roland McGrath <roland@frob.com>
* unix.c (ftp_conn_unix_start_get_stats): Pass dirname a copy of NAME
instead of the original pointer.
-rw-r--r-- | libftpconn/unix.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/libftpconn/unix.c b/libftpconn/unix.c index 7a5136f8..e2a460c7 100644 --- a/libftpconn/unix.c +++ b/libftpconn/unix.c @@ -1,8 +1,7 @@ /* Unix-specific ftpconn hooks - Copyright (C) 1997, 1998 Free Software Foundation, Inc. - - Written by Miles Bader <miles@gnu.ai.mit.edu> + Copyright (C) 1997, 1998, 2002 Free Software Foundation, Inc. + Written by Miles Bader <miles@gnu.org> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -224,7 +223,7 @@ ftp_conn_unix_start_get_stats (struct ftp_conn *conn, than looking it up directly, as not all ftp servers support the -d option to ls. To make sure we get a directory, append '/', except for the root directory. */ - char *dirn = dirname ((char *) name); + char *dirn = dirname (strdupa (name)); int is_root = ! strcmp (dirn, "/"); req_len += strlen (dirn) + (is_root ? 0 : 1); req = malloc (req_len); @@ -244,7 +243,7 @@ ftp_conn_unix_start_get_stats (struct ftp_conn *conn, else sprintf (req, "%s %s%s", flags, slash ? "" : "./", name); } - + if (err) goto out; |