From owner-freebsd-hackers Sun Jul 15 7: 3:14 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from bremen.shuttle.de (bremen.shuttle.de [194.95.249.251]) by hub.freebsd.org (Postfix) with ESMTP id ADC5E37B406 for ; Sun, 15 Jul 2001 07:03:11 -0700 (PDT) (envelope-from schweikh@schweikhardt.net) Received: by bremen.shuttle.de (Postfix, from userid 10) id 4397817D28; Sun, 15 Jul 2001 16:03:10 +0200 (CEST) Received: (from schweikh@localhost) by hal9000.schweikhardt.net (8.11.4/8.11.3) id f6FDxff15191 for hackers@freebsd.org; Sun, 15 Jul 2001 15:59:41 +0200 (CEST) (envelope-from schweikh) Date: Sun, 15 Jul 2001 15:59:41 +0200 From: Jens Schweikhardt To: hackers@freebsd.org Subject: Whitespace at end of line Message-ID: <20010715155941.C1165@schweikhardt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG hello, world\n Dima and /me recently started weeding out white space at end of line for the man pages. I want to widen the weeding to include as much files as possible under /usr/src. We currently have 280kbytes (yes, more than a quarter meg) sitting there; that's counting only the spaces and tabs at EOL, not the whole line. I've got a perl script that removes the white space at EOL automagically, but before I break anything I would like to ask the combined hacker wisdom if you can think of any occasion where whitespace at EOL would be significant and must not be removed. The script already skips non-plain and binary files (as detected by perl's -T/-B file test operators). The only case I can think of right now is a file where we have a backslash followed by whitespace followed by EOL. Removing the whitespace may change semantics if the file type supports the notion of backslash continuation lines, eg. a shell script with echo foo\ <- with a space after the \ bar in it, which would turn to echo "foobar" instead of echo "foo " and executing bar. However, C source should be safe to just s/[ \t]+$//g, I can't think of a valid way to have {backslash whitespace EOL} in C source outside of comments (where the whitespace can safely be removed because the backslash has no continuation semantics.) Regards, Jens -- Jens Schweikhardt http://www.schweikhardt.net/ SIGSIG -- signature too long (core dumped) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message