Strip blank end/front of filenames
authorJens Axboe <jens.axboe@oracle.com>
Tue, 13 Mar 2007 10:18:57 +0000 (11:18 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Tue, 13 Mar 2007 10:18:57 +0000 (11:18 +0100)
We do this for other options.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
init.c

diff --git a/init.c b/init.c
index ba932bf369ce2ab3ffe3b838d18f09c4cf4b4f47..888e68b67137f95f5763d232992e07790d2ceaa9 100644 (file)
--- a/init.c
+++ b/init.c
@@ -1111,7 +1111,13 @@ static int str_filename_cb(void *data, const char *input)
 
        td->nr_files = 0;
        p = str = strdup(input);
+
+       strip_blank_front(&str);
+       strip_blank_end(str);
+
        while ((fname = strsep(&str, ":")) != NULL) {
+               if (!strlen(fname))
+                       break;
                add_file(td, fname);
                td->nr_files++;
        }