diff options
author | Miles Bader <miles@gnu.org> | 1997-08-08 23:37:20 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 1997-08-08 23:37:20 +0000 |
commit | ee08f07c298fa21de6436c79f89c5d63a67b4407 (patch) | |
tree | 61e5a380cd446e901fc17b6462193f57e42d2f96 /libftpconn | |
parent | 2e88d8b9aa54133f6bf50faa94175c3dae6e2ad2 (diff) |
(ftp_conn_cont_get_names):
Use BASENAME hook instead of FIX_NLIST_NAME.
Don't free DIR field.
(ftp_conn_start_get_names):
Don't set DIR field.
(struct get_names_state):
Remove DIR field.
Diffstat (limited to 'libftpconn')
-rw-r--r-- | libftpconn/names.c | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/libftpconn/names.c b/libftpconn/names.c index 2d631bf9..7b0e3977 100644 --- a/libftpconn/names.c +++ b/libftpconn/names.c @@ -31,8 +31,6 @@ struct get_names_state size_t name_alloced; /* Allocated size of NAME (>= NAME_LEN). */ int name_partial; /* True if NAME isn't complete. */ - char *dir; /* Directory being listed. */ - size_t buf_len; /* Length of contents in BUF. */ char buf[7000]; }; @@ -50,19 +48,6 @@ ftp_conn_start_get_names (struct ftp_conn *conn, if (! s) return ENOMEM; - if (conn->syshooks.fix_nlist_name) - /* We only need save the directory name if calling this hook. */ - { - s->dir = strdup (name); - if (! s->dir) - { - free (s); - return ENOMEM; - } - } - else - s->dir = 0; - err = ftp_conn_start_list (conn, name, fd); if (err) @@ -156,12 +141,12 @@ ftp_conn_cont_get_names (struct ftp_conn *conn, int fd, void *state, if (nl) { - /* Fixup any screwy names returned by the server. */ char *name = s->name; - if (conn->syshooks.fix_nlist_name) + if (conn->syshooks.basename) + /* Fixup any screwy names returned by the server. */ { - err = (*conn->syshooks.fix_nlist_name) (conn, s->dir, &name); + err = (*conn->syshooks.basename) (conn, &name); if (err) goto finished; } @@ -211,8 +196,6 @@ finished: return. */ if (s->name) free (s->name); - if (s->dir) - free (s->dir); free (s); close (fd); |