From d508258ad81346389881c6b672e705103b3c762e Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Mon, 3 May 2004 01:18:07 +0000 Subject: [PATCH] Fixed crash bug that can affect --delete in certain circumstances. --- flist.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/flist.c b/flist.c index b1a35381..7c39e538 100644 --- a/flist.c +++ b/flist.c @@ -542,6 +542,9 @@ void receive_file_entry(struct file_struct **fptr, unsigned short flags, return; } + if (!flist || !flist->count) /* Ignore lastdir when invalid. */ + lastdir_len = -1; + if (flags & XMIT_SAME_NAME) l1 = read_byte(f); @@ -745,7 +748,7 @@ struct file_struct *make_file(char *fname, char *basename, *dirname, *bp; unsigned short flags = 0; - if (!flist) /* lastdir isn't valid if flist is NULL */ + if (!flist || !flist->count) /* Ignore lastdir when invalid. */ lastdir_len = -1; if (strlcpy(thisname, fname, sizeof thisname) -- 2.34.1