aboutsummaryrefslogtreecommitdiff
path: root/devel/libcli
diff options
context:
space:
mode:
authorTom Judge <tj@FreeBSD.org>2012-11-10 18:26:36 +0000
committerTom Judge <tj@FreeBSD.org>2012-11-10 18:26:36 +0000
commit00ddaefdf4f20bce4cc685c883f70b39fac8f6c8 (patch)
treeb0cd945f7c7c6ab41ee417b4b7a150bc2ace47cd /devel/libcli
parentb7bec7d93ba6ef221e60627552fef23f089e75dd (diff)
downloadports-00ddaefdf4f20bce4cc685c883f70b39fac8f6c8.tar.gz
ports-00ddaefdf4f20bce4cc685c883f70b39fac8f6c8.zip
Notes
Diffstat (limited to 'devel/libcli')
-rw-r--r--devel/libcli/Makefile3
-rw-r--r--devel/libcli/files/patch-libcli.c60
2 files changed, 62 insertions, 1 deletions
diff --git a/devel/libcli/Makefile b/devel/libcli/Makefile
index e0e02f164832..c5e8a7363b6f 100644
--- a/devel/libcli/Makefile
+++ b/devel/libcli/Makefile
@@ -2,10 +2,11 @@
PORTNAME= libcli
PORTVERSION= 1.9.6
+PORTREVISION= 1
CATEGORIES= devel
MASTER_SITES= http://cloud.github.com/downloads/dparrish/libcli/
-MAINTAINER= bapt@FreeBSD.org
+MAINTAINER= tj@FreeBSD.org
COMMENT= Emulates a Cisco style command-line interface
LICENSE= LGPL21
diff --git a/devel/libcli/files/patch-libcli.c b/devel/libcli/files/patch-libcli.c
new file mode 100644
index 000000000000..e7be459a4d91
--- /dev/null
+++ b/devel/libcli/files/patch-libcli.c
@@ -0,0 +1,60 @@
+diff --git a/libcli.c b/libcli.c
+index de6e2e9..59dd42f 100644
+--- libcli.c
++++ libcli.c
+@@ -1017,7 +1017,7 @@ static int cli_get_completions(struct cli_def *cli, const char *command, char **
+ {
+ struct cli_command *c;
+ struct cli_command *n;
+- int num_words, i, k=0;
++ int num_words, save_words, i, k=0;
+ char *words[CLI_MAX_LINE_WORDS] = {0};
+ int filter = 0;
+
+@@ -1025,12 +1025,12 @@ static int cli_get_completions(struct cli_def *cli, const char *command, char **
+ while (isspace(*command))
+ command++;
+
+- num_words = cli_parse_line(command, words, sizeof(words)/sizeof(words[0]));
++ save_words = num_words = cli_parse_line(command, words, sizeof(words)/sizeof(words[0]));
+ if (!command[0] || command[strlen(command)-1] == ' ')
+ num_words++;
+
+ if (!num_words)
+- return 0;
++ goto out;
+
+ for (i = 0; i < num_words; i++)
+ {
+@@ -1043,7 +1043,7 @@ static int cli_get_completions(struct cli_def *cli, const char *command, char **
+ unsigned len = 0;
+
+ if (filter < num_words - 1) // filter already completed
+- return 0;
++ goto out;
+
+ if (filter == num_words - 1)
+ len = strlen(words[num_words-1]);
+@@ -1055,7 +1055,7 @@ static int cli_get_completions(struct cli_def *cli, const char *command, char **
+ }
+
+ completions[k] = NULL;
+- return k;
++ goto out;
+ }
+
+ for (c = cli->commands, i = 0; c && i < num_words && k < max_completions; c = n)
+@@ -1084,6 +1084,10 @@ static int cli_get_completions(struct cli_def *cli, const char *command, char **
+ completions[k++] = c->command;
+ }
+
++out:
++ for (i = 0; i < save_words; i++)
++ free(words[i]);
++
+ return k;
+ }
+
+--
+1.7.10
+