Although the file has "ex:ts=4", do some " " -> \t translations

so that it is also nicely readable with ts=8.
This commit is contained in:
Edwin Groothuis 2009-11-12 21:51:01 +00:00
parent f9d551f7df
commit c2eeded255
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=199236

View file

@ -94,13 +94,13 @@ __FBSDID("$FreeBSD$");
struct _msgT { struct _msgT {
long msgId; long msgId;
char *str; char *str;
LIST_ENTRY(_msgT) entries; LIST_ENTRY(_msgT) entries;
}; };
struct _setT { struct _setT {
long setId; long setId;
LIST_HEAD(msghead, _msgT) msghead; LIST_HEAD(msghead, _msgT) msghead;
LIST_ENTRY(_setT) entries; LIST_ENTRY(_setT) entries;
}; };
LIST_HEAD(sethead, _setT) sethead; LIST_HEAD(sethead, _setT) sethead;
@ -133,14 +133,14 @@ void
usage() usage()
{ {
fprintf(stderr, "usage: %s catfile msgfile ...\n", getprogname()); fprintf(stderr, "usage: %s catfile msgfile ...\n", getprogname());
exit(1); exit(1);
} }
int int
main(int argc, char **argv) main(int argc, char **argv)
{ {
int ofd, ifd; int ofd, ifd;
char *catfile = NULL; char *catfile = NULL;
int c; int c;
#define DEPRECATEDMSG 1 #define DEPRECATEDMSG 1
@ -419,23 +419,23 @@ MCParse(int fd)
cptr += 5; cptr += 5;
if (!*cptr) if (!*cptr)
quote = 0; quote = 0;
else { else {
cptr = wskip(cptr); cptr = wskip(cptr);
if (!*cptr) if (!*cptr)
quote = 0; quote = 0;
else else
quote = *cptr; quote = *cptr;
} }
} else if (isspace((unsigned char) *cptr)) { } else if (isspace((unsigned char) *cptr)) {
; ;
} else { } else {
if (*cptr) { if (*cptr) {
cptr = wskip(cptr); cptr = wskip(cptr);
if (*cptr) if (*cptr)
warning(cptr, "unrecognized line"); warning(cptr, "unrecognized line");
} }
} }
} else { } else {
/* /*
* First check for (and eat) empty lines.... * First check for (and eat) empty lines....
*/ */
@ -453,7 +453,7 @@ MCParse(int fd)
} else { } else {
warning(cptr, "neither blank line nor start of a message id"); warning(cptr, "neither blank line nor start of a message id");
continue; continue;
} }
/* /*
* If we have a message ID, but no message, * If we have a message ID, but no message,
* then this means "delete this message id * then this means "delete this message id
@ -461,12 +461,12 @@ MCParse(int fd)
*/ */
if (!*cptr) { if (!*cptr) {
MCDelMsg(msgid); MCDelMsg(msgid);
} else { } else {
str = getmsg(fd, cptr, quote); str = getmsg(fd, cptr, quote);
MCAddMsg(msgid, str); MCAddMsg(msgid, str);
} }
}
} }
}
} }
void void
@ -686,7 +686,7 @@ MCAddSet(int setId)
if (p && p->setId == setId) { if (p && p->setId == setId) {
; ;
} else { } else {
p = xmalloc(sizeof(struct _setT)); p = xmalloc(sizeof(struct _setT));
memset(p, '\0', sizeof(struct _setT)); memset(p, '\0', sizeof(struct _setT));
LIST_INIT(&p->msghead); LIST_INIT(&p->msghead);
@ -697,8 +697,8 @@ MCAddSet(int setId)
LIST_INSERT_HEAD(&sethead, p, entries); LIST_INSERT_HEAD(&sethead, p, entries);
} else { } else {
LIST_INSERT_AFTER(q, p, entries); LIST_INSERT_AFTER(q, p, entries);
} }
} }
curSet = p; curSet = p;
} }
@ -718,7 +718,7 @@ MCAddMsg(int msgId, const char *str)
if (msgId > NL_MSGMAX) { if (msgId > NL_MSGMAX) {
error("msgID exceeds limit"); error("msgID exceeds limit");
/* NOTREACHED */ /* NOTREACHED */
} }
p = curSet->msghead.lh_first; p = curSet->msghead.lh_first;
q = NULL; q = NULL;
@ -739,7 +739,7 @@ MCAddMsg(int msgId, const char *str)
p->msgId = msgId; p->msgId = msgId;
p->str = xstrdup(str); p->str = xstrdup(str);
} }
void void
MCDelSet(int setId) MCDelSet(int setId)
@ -756,13 +756,13 @@ MCDelSet(int setId)
while (msg) { while (msg) {
free(msg->str); free(msg->str);
LIST_REMOVE(msg, entries); LIST_REMOVE(msg, entries);
} }
LIST_REMOVE(set, entries); LIST_REMOVE(set, entries);
return; return;
}
warning(NULL, "specified set doesn't exist");
} }
warning(NULL, "specified set doesn't exist");
}
void void
MCDelMsg(int msgId) MCDelMsg(int msgId)
@ -779,6 +779,6 @@ MCDelMsg(int msgId)
free(msg->str); free(msg->str);
LIST_REMOVE(msg, entries); LIST_REMOVE(msg, entries);
return; return;
} }
warning(NULL, "specified msg doesn't exist"); warning(NULL, "specified msg doesn't exist");
} }