From owner-cvs-all@FreeBSD.ORG Fri Mar 7 00:01:19 2008 Return-Path: Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 885B6106566C; Fri, 7 Mar 2008 00:01:19 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 78F428FC16; Fri, 7 Mar 2008 00:01:19 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m2701J1c059854; Fri, 7 Mar 2008 00:01:19 GMT (envelope-from delphij@repoman.freebsd.org) Received: (from delphij@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m2701Jdm059853; Fri, 7 Mar 2008 00:01:19 GMT (envelope-from delphij) Message-Id: <200803070001.m2701Jdm059853@repoman.freebsd.org> From: Xin LI Date: Fri, 7 Mar 2008 00:01:19 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/usr.bin/chat chat.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2008 00:01:19 -0000 delphij 2008-03-07 00:01:19 UTC FreeBSD src repository Modified files: usr.bin/chat chat.c Log: Merge revisions 1.10 and 1.11 from DragonFly: - Use real getopt() handling instead of the hand-rolled and IOCCC-worthy "Micro getopt()" macros, plus clean up to the option handling code: * Sort the options in the switch statement; * Plug piddling memory leaks when processing repeated options by freeing strings before allocating them for a second time; * Die with a fatal error if the requested report file cannot be opened for appending; * Don't call init() before usage() (to prevent the usage message being mangled by changes to the terminal settings;) - Clean up the usage message, both in usage() and in the main program comment, both stylistically (sort and combine options) and for accuracy (following the manual page, make note of the -s and -S flags, and use the term 'send' instead of 'say' to reduce confusion (SAY is the name of a command for output to the user, not the connection.)) Obtained from: DragonFly Revision Changes Path 1.22 +61 -68 src/usr.bin/chat/chat.c