summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1996-05-23 00:27:49 +0000
committerMiles Bader <miles@gnu.org>1996-05-23 00:27:49 +0000
commitd99365c0c6614a2604c2bfe4cf14137dc31d6347 (patch)
tree9e31a7b9f68d622e26a39f4000dd1b875ba0405d
parent8c7a3d0561cf1a2ad9502295bd5ea26df85fa717 (diff)
(_fmt_create):
Increment SRC when reading modifiers. Recognize '^' modifier.
-rw-r--r--libps/fmt.c38
1 files changed, 21 insertions, 17 deletions
diff --git a/libps/fmt.c b/libps/fmt.c
index 145cade5..2d0fbe40 100644
--- a/libps/fmt.c
+++ b/libps/fmt.c
@@ -121,23 +121,27 @@ _fmt_create (char *src, int posix, struct ps_fmt_specs *fmt_specs,
int clr_flags = global_clr_flags, inv_flags = global_inv_flags;
/* Set modifiers. */
- while (*src == '@' || *src == ':' || *src == '!' || *src == '?')
- if (*src == '@')
- inv_flags ^= PS_FMT_FIELD_AT_MOD; /* Toggle */
- else if (*src == ':')
- inv_flags ^= PS_FMT_FIELD_COLON_MOD; /* Toggle */
- else if (*src == '^')
- inv_flags ^= PS_FMT_FIELD_UPCASE_TITLE; /* Toggle */
- else if (*src == '!')
- { /* Set */
- clr_flags |= PS_FMT_FIELD_KEEP;
- inv_flags |= PS_FMT_FIELD_KEEP;
- }
- else if (*src == '?')
- { /* Clear */
- clr_flags |= PS_FMT_FIELD_KEEP;
- inv_flags &= ~PS_FMT_FIELD_KEEP;
- }
+ while (*src == '@' || *src == ':'
+ || *src == '!' || *src == '?' || *src == '^')
+ {
+ if (*src == '@')
+ inv_flags ^= PS_FMT_FIELD_AT_MOD; /* Toggle */
+ else if (*src == ':')
+ inv_flags ^= PS_FMT_FIELD_COLON_MOD; /* Toggle */
+ else if (*src == '^')
+ inv_flags ^= PS_FMT_FIELD_UPCASE_TITLE; /* Toggle */
+ else if (*src == '!')
+ { /* Set */
+ clr_flags |= PS_FMT_FIELD_KEEP;
+ inv_flags |= PS_FMT_FIELD_KEEP;
+ }
+ else if (*src == '?')
+ { /* Clear */
+ clr_flags |= PS_FMT_FIELD_KEEP;
+ inv_flags &= ~PS_FMT_FIELD_KEEP;
+ }
+ src++;
+ }
/* Read an explicit field width. */
field->width = 0;