summaryrefslogtreecommitdiff
path: root/src/format.c
diff options
context:
space:
mode:
authorsabetts <sabetts>2006-03-16 00:33:34 +0000
committersabetts <sabetts>2006-03-16 00:33:34 +0000
commit9cb1a3d51b8cba35ef443c64b5b1d99fa8d33ae6 (patch)
treec6b2230a429ae887eed80487d1833c1eec129447 /src/format.c
parent0ad6d8b36f975c43f37b0ad07112c2cd31003417 (diff)
downloadratpoison-9cb1a3d51b8cba35ef443c64b5b1d99fa8d33ae6.zip
remove tabs and trailing whitespace.
Diffstat (limited to 'src/format.c')
-rw-r--r--src/format.c88
1 files changed, 44 insertions, 44 deletions
diff --git a/src/format.c b/src/format.c
index bbe463c..a70d6fc 100644
--- a/src/format.c
+++ b/src/format.c
@@ -105,56 +105,56 @@ format_string (char *fmt, rp_window_elem *win_elem, struct sbuf *buffer)
for(; *fmt; fmt++)
{
if (*fmt == '%' && state == STATE_READ)
- {
- state = STATE_ESCAPE;
- continue;
- }
+ {
+ state = STATE_ESCAPE;
+ continue;
+ }
if ((state == STATE_ESCAPE || state == STATE_NUMBER) && isdigit(*fmt))
- {
- /* Accumulate the width one digit at a time. */
- if (state == STATE_ESCAPE)
- width = 0;
- width *= 10;
- width += *fmt - '0';
- state = STATE_NUMBER;
- continue;
- }
+ {
+ /* Accumulate the width one digit at a time. */
+ if (state == STATE_ESCAPE)
+ width = 0;
+ width *= 10;
+ width += *fmt - '0';
+ state = STATE_NUMBER;
+ continue;
+ }
found = 0;
if (state == STATE_ESCAPE || state == STATE_NUMBER)
- {
- if (*fmt == '%')
- sbuf_concat (buffer, "%");
- else
- {
- for (fip = 0; fmt_items[fip].fmt_char; fip++)
- {
- if (fmt_items[fip].fmt_char == *fmt)
- {
- sbuf_clear (retbuf);
- fmt_items[fip].fmt_fn(win_elem, retbuf);
- concat_width (buffer, sbuf_get (retbuf), width);
- found = 1;
- break;
- }
- }
- if (!found)
- {
- sbuf_printf_concat (buffer, "%%%c", *fmt);
- break;
- }
- }
- state = STATE_READ;
- width = -1;
- }
+ {
+ if (*fmt == '%')
+ sbuf_concat (buffer, "%");
+ else
+ {
+ for (fip = 0; fmt_items[fip].fmt_char; fip++)
+ {
+ if (fmt_items[fip].fmt_char == *fmt)
+ {
+ sbuf_clear (retbuf);
+ fmt_items[fip].fmt_fn(win_elem, retbuf);
+ concat_width (buffer, sbuf_get (retbuf), width);
+ found = 1;
+ break;
+ }
+ }
+ if (!found)
+ {
+ sbuf_printf_concat (buffer, "%%%c", *fmt);
+ break;
+ }
+ }
+ state = STATE_READ;
+ width = -1;
+ }
else
- {
- /* Insert the character. */
- dbuf[0] = *fmt;
- dbuf[1] = 0;
- sbuf_concat (buffer, dbuf);
- }
+ {
+ /* Insert the character. */
+ dbuf[0] = *fmt;
+ dbuf[1] = 0;
+ sbuf_concat (buffer, dbuf);
+ }
}
sbuf_free (retbuf);
#undef STATE_READ