From owner-svn-src-head@FreeBSD.ORG Thu Nov 12 21:51:02 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54E481065670; Thu, 12 Nov 2009 21:51:02 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4377B8FC08; Thu, 12 Nov 2009 21:51:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nACLp25c044412; Thu, 12 Nov 2009 21:51:02 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nACLp2wn044410; Thu, 12 Nov 2009 21:51:02 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200911122151.nACLp2wn044410@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 12 Nov 2009 21:51:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199236 - head/usr.bin/gencat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2009 21:51:02 -0000 Author: edwin Date: Thu Nov 12 21:51:01 2009 New Revision: 199236 URL: http://svn.freebsd.org/changeset/base/199236 Log: Although the file has "ex:ts=4", do some " " -> \t translations so that it is also nicely readable with ts=8. Modified: head/usr.bin/gencat/gencat.c Modified: head/usr.bin/gencat/gencat.c ============================================================================== --- head/usr.bin/gencat/gencat.c Thu Nov 12 21:33:36 2009 (r199235) +++ head/usr.bin/gencat/gencat.c Thu Nov 12 21:51:01 2009 (r199236) @@ -94,13 +94,13 @@ __FBSDID("$FreeBSD$"); struct _msgT { long msgId; char *str; - LIST_ENTRY(_msgT) entries; + LIST_ENTRY(_msgT) entries; }; struct _setT { long setId; - LIST_HEAD(msghead, _msgT) msghead; - LIST_ENTRY(_setT) entries; + LIST_HEAD(msghead, _msgT) msghead; + LIST_ENTRY(_setT) entries; }; LIST_HEAD(sethead, _setT) sethead; @@ -133,14 +133,14 @@ void usage() { fprintf(stderr, "usage: %s catfile msgfile ...\n", getprogname()); - exit(1); + exit(1); } int main(int argc, char **argv) { int ofd, ifd; - char *catfile = NULL; + char *catfile = NULL; int c; #define DEPRECATEDMSG 1 @@ -419,23 +419,23 @@ MCParse(int fd) cptr += 5; if (!*cptr) quote = 0; - else { + else { cptr = wskip(cptr); if (!*cptr) quote = 0; else quote = *cptr; - } + } } else if (isspace((unsigned char) *cptr)) { ; - } else { + } else { if (*cptr) { cptr = wskip(cptr); if (*cptr) warning(cptr, "unrecognized line"); } - } - } else { + } + } else { /* * First check for (and eat) empty lines.... */ @@ -453,7 +453,7 @@ MCParse(int fd) } else { warning(cptr, "neither blank line nor start of a message id"); continue; - } + } /* * If we have a message ID, but no message, * then this means "delete this message id @@ -461,12 +461,12 @@ MCParse(int fd) */ if (!*cptr) { MCDelMsg(msgid); - } else { + } else { str = getmsg(fd, cptr, quote); MCAddMsg(msgid, str); - } + } + } } - } } void @@ -686,7 +686,7 @@ MCAddSet(int setId) if (p && p->setId == setId) { ; - } else { + } else { p = xmalloc(sizeof(struct _setT)); memset(p, '\0', sizeof(struct _setT)); LIST_INIT(&p->msghead); @@ -697,8 +697,8 @@ MCAddSet(int setId) LIST_INSERT_HEAD(&sethead, p, entries); } else { LIST_INSERT_AFTER(q, p, entries); - } -} + } + } curSet = p; } @@ -718,7 +718,7 @@ MCAddMsg(int msgId, const char *str) if (msgId > NL_MSGMAX) { error("msgID exceeds limit"); /* NOTREACHED */ - } + } p = curSet->msghead.lh_first; q = NULL; @@ -739,7 +739,7 @@ MCAddMsg(int msgId, const char *str) p->msgId = msgId; p->str = xstrdup(str); - } +} void MCDelSet(int setId) @@ -756,13 +756,13 @@ MCDelSet(int setId) while (msg) { free(msg->str); LIST_REMOVE(msg, entries); - } + } LIST_REMOVE(set, entries); return; - } - warning(NULL, "specified set doesn't exist"); } + warning(NULL, "specified set doesn't exist"); +} void MCDelMsg(int msgId) @@ -779,6 +779,6 @@ MCDelMsg(int msgId) free(msg->str); LIST_REMOVE(msg, entries); return; - } + } warning(NULL, "specified msg doesn't exist"); }