From c7a1d7c25668b82293db3bee5cbf0f0a80a2feec Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 21 Jun 2013 18:58:22 +0200 Subject: give value to args_message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/argparser.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/argparser.c b/src/argparser.c index 018dc58..f1b9359 100644 --- a/src/argparser.c +++ b/src/argparser.c @@ -821,7 +821,28 @@ extern long args_parse(int argc, char** argv) free(optqueue); free(freequeue); - /* TODO ' '.join(self.files) if len(self.files) > 0 else None */ + args_message = null; + if (args_files_count > 0) + { + long n = args_files_count, i, j; + for (i = 0; i < args_files_count; i++) + { + char* file = *(args_files + i); + for (j = 0; *(file + j); j++) + ; + n += j; + } + args_message = (char*)malloc(n * sizeof(char)); + n = 0; + for (i = 0; i < args_files_count; i++) + { + char* file = *(args_files + i); + for (j = 0; *(file + j); j++) + *(args_message + n++) = *(file + j); + *(args_message + n++) = ' '; + } + *(args_message + --n) = 0; + } if (args_unrecognsed_count > 5) { -- cgit v1.2.3-70-g09d2