summaryrefslogtreecommitdiffstats
path: root/cmd-source-file.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-01-18 14:40:48 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-01-18 14:40:48 +0000
commita15f8fc4a66420615d237313c6a01fcf532c52a2 (patch)
tree751d858639e20ae413ec907f7cf3215c06e3820d /cmd-source-file.c
parentc4d5989a4ef03db0477446ee004ef431be268286 (diff)
Support command sequences separated by " ; ". Also clean up command printing.
Diffstat (limited to 'cmd-source-file.c')
-rw-r--r--cmd-source-file.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/cmd-source-file.c b/cmd-source-file.c
index 900f7379..501eb060 100644
--- a/cmd-source-file.c
+++ b/cmd-source-file.c
@@ -1,4 +1,4 @@
-/* $Id: cmd-source-file.c,v 1.3 2009-01-07 08:10:02 nicm Exp $ */
+/* $Id: cmd-source-file.c,v 1.4 2009-01-18 14:40:48 nicm Exp $ */
/*
* Copyright (c) 2008 Tiago Cunha <me@tiagocunha.org>
@@ -30,7 +30,7 @@ void cmd_source_file_send(struct cmd *, struct buffer *);
void cmd_source_file_recv(struct cmd *, struct buffer *);
void cmd_source_file_free(struct cmd *);
void cmd_source_file_init(struct cmd *, int);
-void cmd_source_file_print(struct cmd *, char *, size_t);
+size_t cmd_source_file_print(struct cmd *, char *, size_t);
struct cmd_source_file_data {
char *path;
@@ -133,7 +133,7 @@ cmd_source_file_free(struct cmd *self)
xfree(data);
}
-void
+size_t
cmd_source_file_print(struct cmd *self, char *buf, size_t len)
{
struct cmd_source_file_data *data = self->data;
@@ -141,7 +141,8 @@ cmd_source_file_print(struct cmd *self, char *buf, size_t len)
off += xsnprintf(buf, len, "%s", self->entry->name);
if (data == NULL)
- return;
+ return (off);
if (off < len && data->path != NULL)
- off += xsnprintf(buf + off, len - off, " %s", data->path);
+ off += cmd_prarg(buf + off, len - off, " ", data->path);
+ return (off);
}