diff options
author | Gao Xiang <hsiangkao@linux.alibaba.com> | 2023-02-23 03:11:46 +0800 |
---|---|---|
committer | Gao Xiang <hsiangkao@linux.alibaba.com> | 2023-02-23 03:18:23 +0800 |
commit | 30ac132e4d5c218e9510cfc62f426f4e9ea58888 (patch) | |
tree | 94000139277c8987ab3aae698fcf4455358b8214 | |
parent | 5653f1a6c08bb3d6fe08c98ce6372a103de8f3ef (diff) | |
download | erofs-utils-30ac132e4d5c218e9510cfc62f426f4e9ea58888.tar.gz |
erofs-utils: ignore comments and blank lines in compress hints
Identify lines starting with '#' as a comment.
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/20230222191148.112677-1-hsiangkao@linux.alibaba.com
-rw-r--r-- | lib/compress_hints.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/compress_hints.c b/lib/compress_hints.c index 92964eb..3e5c8c8 100644 --- a/lib/compress_hints.c +++ b/lib/compress_hints.c @@ -101,6 +101,9 @@ int erofs_load_compress_hints(void) unsigned int pclustersize; char *pattern; + if (*buf == '#' || *buf == '\n') + continue; + pclustersize = atoi(strtok(buf, "\t ")); pattern = strtok(NULL, "\n"); if (!pattern || *pattern == '\0') { |