diff options
author | Andreas Dilger <adilger@whamcloud.com> | 2020-02-06 18:09:42 -0700 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2020-02-29 18:29:50 -0500 |
commit | 334e9a5aad0857ddf878fafb136f17659666377b (patch) | |
tree | e6cee8dddd976963680b6f0ea69e3054efc6ddce | |
parent | abeb84e31d69d97669da0785e5f53587438e76ed (diff) | |
download | e2fsprogs-334e9a5aad0857ddf878fafb136f17659666377b.tar.gz |
debugfs: allow comment lines in command file
Allow comment lines with '#' at the start of the line in the command
file passed in to debugfs via the "-f" option or from standard input.
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Lustre-bug-id: https://jira.whamcloud.com/browse/LU-13197
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-rw-r--r-- | debugfs/debugfs.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c index e33c92ef6..6325f2548 100644 --- a/debugfs/debugfs.c +++ b/debugfs/debugfs.c @@ -2494,6 +2494,10 @@ static int source_file(const char *cmd_file, int ss_idx) while (!feof(f)) { if (fgets(buf, sizeof(buf), f) == NULL) break; + if (buf[0] == '#') { + printf("%s", buf); + continue; + } cp = strchr(buf, '\n'); if (cp) *cp = 0; |