aboutsummaryrefslogtreecommitdiff
path: root/cmd.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2008-06-23 07:41:21 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2008-06-23 07:41:21 +0000
commitc24d849fa41114108b52a0a5e9256a7f0558b0d8 (patch)
tree93dbcffb22bbddf9181fbc3e89d93d8e36bb6afd /cmd.c
parente013970b0b0b44bf871233cffcf5ca77ce700e2e (diff)
downloadrtmux-c24d849fa41114108b52a0a5e9256a7f0558b0d8.tar.gz
rtmux-c24d849fa41114108b52a0a5e9256a7f0558b0d8.tar.bz2
rtmux-c24d849fa41114108b52a0a5e9256a7f0558b0d8.zip
Split options into a table to allow abbreviations.
Diffstat (limited to 'cmd.c')
-rw-r--r--cmd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd.c b/cmd.c
index 26c36b72..e7c9e810 100644
--- a/cmd.c
+++ b/cmd.c
@@ -1,4 +1,4 @@
-/* $Id: cmd.c,v 1.54 2008-06-21 14:16:30 nicm Exp $ */
+/* $Id: cmd.c,v 1.55 2008-06-23 07:41:21 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -75,7 +75,7 @@ cmd_complete(const char *s)
{
const struct cmd_entry **entryp;
ARRAY_DECL(, const char *) list;
- char *prefix;
+ char *prefix, *s2;
u_int i;
size_t j;
@@ -98,9 +98,9 @@ cmd_complete(const char *s)
/* If an exact match, return it, with a trailing space. */
if (ARRAY_LENGTH(&list) == 1) {
- xasprintf(&s, "%s ", ARRAY_FIRST(&list));
+ xasprintf(&s2, "%s ", ARRAY_FIRST(&list));
ARRAY_FREE(&list);
- return (s);
+ return (s2);
}
/* Now loop through the list and find the longest common prefix. */