From ebde27381b403af79ba25cc2d8f3e3823a8ba764 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 3 Jan 2010 13:00:58 +0100 Subject: Preserve leading spaces, document shell problems with whitespaces & IFS --- src/envstore.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/envstore.c') diff --git a/src/envstore.c b/src/envstore.c index 43e6d56..3592b29 100644 --- a/src/envstore.c +++ b/src/envstore.c @@ -20,7 +20,7 @@ #define PARAM_LENGTH 256 #define VALUE_LENGTH 1024 -#define SCAN_FORMAT "%255s %1023[^\n]\n" +#define SCAN_FORMAT "%255s%*1[ ]%1023[^\n]\n" static FILE * store_open(char *file) { struct stat finfo; @@ -108,13 +108,13 @@ static void command_disp(char *file, int command) { if (read_items == 0) errx(EXIT_FAILURE, "Unable to read items, store file '%s' corrupt?", file); - else if (read_items == 1) - vcontent[0] = '\0'; if (command == CMD_LIST) printf("%-15s = %s\n", vname, vcontent); else print_escaped(vname, vcontent); + vname[0] = '\0'; + vcontent[0] = '\0'; } if (fclose(fp) != 0) err(EXIT_FAILURE, "fclose %s", file); -- cgit v1.2.3