summaryrefslogtreecommitdiff
path: root/lib/e2p
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2006-03-23 22:00:01 -0500
committerTheodore Ts'o <tytso@mit.edu>2006-03-23 22:00:01 -0500
commit9dc6ad1ecb0ba3caf14e05279f1cc3cea52095a2 (patch)
treea5187c0cc6f5da7a4629e0b3a22bdfff0707d03b /lib/e2p
parent204ae371ad2e038b41c03aba13d3a57e4e6921ec (diff)
downloade2fsprogs-9dc6ad1ecb0ba3caf14e05279f1cc3cea52095a2.tar.gz
Change mke2fs to use /etc/mke2fs.conf as a configuration file
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'lib/e2p')
-rw-r--r--lib/e2p/ChangeLog6
-rw-r--r--lib/e2p/feature.c14
2 files changed, 17 insertions, 3 deletions
diff --git a/lib/e2p/ChangeLog b/lib/e2p/ChangeLog
index 763f9406..756227b9 100644
--- a/lib/e2p/ChangeLog
+++ b/lib/e2p/ChangeLog
@@ -1,3 +1,9 @@
+2006-03-23 Theodore Ts'o <tytso@mit.edu>
+
+ * feature.c (e2p_edit_feature): If the pseudo-feature "none" or
+ "clear" is specified, then zero out all of the feature
+ masks.
+
2005-12-10 Theodore Ts'o <tytso@mit.edu>
* Makefile.in: Add a dependency to make sure that the
diff --git a/lib/e2p/feature.c b/lib/e2p/feature.c
index ef11d93b..50f1ef3d 100644
--- a/lib/e2p/feature.c
+++ b/lib/e2p/feature.c
@@ -158,15 +158,24 @@ int e2p_edit_feature(const char *str, __u32 *compat_array, __u32 *ok_array)
if (!buf)
return 1;
strcpy(buf, str);
- cp = buf;
- while (cp && *cp) {
+ for (cp = buf; cp && *cp; cp = next ? next+1 : 0) {
neg = 0;
cp = skip_over_blanks(cp);
next = skip_over_word(cp);
+
if (*next == 0)
next = 0;
else
*next = 0;
+
+ if ((strcasecmp(cp, "none") == 0) ||
+ (strcasecmp(cp, "clear") == 0)) {
+ compat_array[0] = 0;
+ compat_array[1] = 0;
+ compat_array[2] = 0;
+ continue;
+ }
+
switch (*cp) {
case '-':
case '^':
@@ -183,7 +192,6 @@ int e2p_edit_feature(const char *str, __u32 *compat_array, __u32 *ok_array)
compat_array[compat_type] &= ~mask;
else
compat_array[compat_type] |= mask;
- cp = next ? next+1 : 0;
}
return 0;
}