From owner-cvs-all Thu Jun 13 18:28:56 2002 Delivered-To: cvs-all@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id AA67A37B40B; Thu, 13 Jun 2002 18:28:52 -0700 (PDT) Received: (from sobomax@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g5E1Sqd34821; Thu, 13 Jun 2002 18:28:52 -0700 (PDT) (envelope-from sobomax) Message-Id: <200206140128.g5E1Sqd34821@freefall.freebsd.org> From: Maxim Sobolev Date: Thu, 13 Jun 2002 18:28:52 -0700 (PDT) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/usr.bin/sed main.c X-FreeBSD-CVS-Branch: HEAD Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG sobomax 2002/06/13 18:28:52 PDT Modified files: usr.bin/sed main.c Log: Fix one serious bug and one potential problem with in-place editing code: - original version of code worked incorrectly when more than one input files were specified - it was moving the last line from the 1st file to be the first line of the 2nd, last line of the 2nd to be the first line of the 3rd and so on; - use mmap()->write() to create temporary file instead of malloc()->read()->write(), which was not only slower, but also did not bother to free allocated memory once backup file was created, potentially leading to memory exhausting when regex is applied to a big file or a large number of small ones. Revision Changes Path 1.22 +60 -70 src/usr.bin/sed/main.c To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message