summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2007-08-27 10:16:54 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:02:49 -0500
commite98b3c1e97421e8757af8c19c3d2738cbe301555 (patch)
treeef9644db5f803be2546994acbe790071dfccf0ee /source4
parentb8da2d1ee512c00c4804d2db80d07d3442d9852f (diff)
downloadsamba-e98b3c1e97421e8757af8c19c3d2738cbe301555.tar.gz
samba-e98b3c1e97421e8757af8c19c3d2738cbe301555.tar.bz2
samba-e98b3c1e97421e8757af8c19c3d2738cbe301555.zip
r24698: Patch from Andrew Kroeger <andrew@sprocks.gotdns.com> to fix Bug
#4521: smbclient crashes during tab completion when tab hit twice. The readline magic is beyond me, but this seems to do the trick. Andrew Bartlett (This used to be commit e05f3450ecc3f99509fbc069b09d402e3b6d7564)
Diffstat (limited to 'source4')
-rw-r--r--source4/client/client.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source4/client/client.c b/source4/client/client.c
index a10d4254a3..1fdbec4bfd 100644
--- a/source4/client/client.c
+++ b/source4/client/client.c
@@ -2922,9 +2922,10 @@ static char **completion_fn(const char *text, int start, int end)
return matches;
cleanup:
- while (i >= 0) {
- free(matches[i]);
- i--;
+ count--;
+ while (count >= 0) {
+ free(matches[count]);
+ count--;
}
free(matches);
return NULL;