mblaze

Unix utilities to deal with Maildir - my mirror
git clone https://pi.duncano.de/git/mblaze.git
Log | Files | Refs | README | COPYING

commit c561aca4c9affa597d6a36d39d8a65c58ca78c87
parent e31cd95dc2be55573d083c55636fe5d19c1421e6
Author: Leah Neukirchen <leah@vuxu.org>
Date:   Wed, 25 Jan 2017 16:20:00 +0100

mflag: add: skip leading whitespace

Diffstat:
mflag.c | 22++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/mflag.c b/mflag.c @@ -26,16 +26,18 @@ char *curfile; void add(char *file) { - if (idx >= argsalloc) { - argsalloc *= 2; - if (argsalloc < 0) - exit(-1); - args = realloc(args, sizeof (char *) * argsalloc); - } - if (!args) - exit(-1); - args[idx] = strdup(file); - idx++; + if (idx >= argsalloc) { + argsalloc *= 2; + if (argsalloc < 0) + exit(-1); + args = realloc(args, sizeof (char *) * argsalloc); + } + if (!args) + exit(-1); + while (*file == ' ' || *file == '\t') + file++; + args[idx] = strdup(file); + idx++; } void