X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/0f7432ccaf5a113b5387171797c21381f35603e5..7d2c1789c5a8ccf8a767fb11082bff34c1b7c5aa:/sftp.c diff --git a/sftp.c b/sftp.c index 9ffd19c9..e1f60173 100644 --- a/sftp.c +++ b/sftp.c @@ -923,3 +923,28 @@ void fxp_free_names(struct fxp_names *names) sfree(names->names); sfree(names); } + +/* + * Duplicate an fxp_name structure. + */ +struct fxp_name *fxp_dup_name(struct fxp_name *name) +{ + struct fxp_name *ret; + ret = smalloc(sizeof(struct fxp_name)); + ret->filename = dupstr(name->filename); + ret->longname = dupstr(name->longname); + ret->attrs = name->attrs; /* structure copy */ + return ret; +} + +/* + * Free up an fxp_name structure. + */ +void fxp_free_name(struct fxp_name *name) +{ + int i; + + sfree(name->filename); + sfree(name->longname); + sfree(name); +}