diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2008-06-23 07:41:21 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2008-06-23 07:41:21 +0000 |
commit | c24d849fa41114108b52a0a5e9256a7f0558b0d8 (patch) | |
tree | 93dbcffb22bbddf9181fbc3e89d93d8e36bb6afd /cmd.c | |
parent | e013970b0b0b44bf871233cffcf5ca77ce700e2e (diff) | |
download | rtmux-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.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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. */ |