summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/store.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libglusterfs/src/store.c b/libglusterfs/src/store.c
index 199ba2960d1..e805f20bb4c 100644
--- a/libglusterfs/src/store.c
+++ b/libglusterfs/src/store.c
@@ -195,6 +195,7 @@ gf_store_read_and_tokenize (FILE *file, char *str, int size, char **iter_key,
GF_ASSERT (iter_val);
GF_ASSERT (store_errno);
+retry:
temp = fgets (str, size, file);
if (temp == NULL || feof (file)) {
ret = -1;
@@ -202,6 +203,9 @@ gf_store_read_and_tokenize (FILE *file, char *str, int size, char **iter_key,
goto out;
}
+ if (strcmp (str, "\n") == 0)
+ goto retry;
+
str_len = strlen(str);
str[str_len - 1] = '\0';
/* Truncate the "\n", as fgets stores "\n" in str */