From d99365c0c6614a2604c2bfe4cf14137dc31d6347 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Thu, 23 May 1996 00:27:49 +0000 Subject: (_fmt_create): Increment SRC when reading modifiers. Recognize '^' modifier. --- libps/fmt.c | 38 +++++++++++++++++++++----------------- 1 file 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; -- cgit v1.2.3