From owner-freebsd-ports@FreeBSD.ORG Sun Jun 26 18:48:57 2005 Return-Path: X-Original-To: freebsd-ports@FreeBSD.org Delivered-To: freebsd-ports@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D68E916A41C; Sun, 26 Jun 2005 18:48:57 +0000 (GMT) (envelope-from sammy@lost-angel.com) Received: from orwell.lost-angel.com (lost-angel.com [64.159.65.105]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7E20043D58; Sun, 26 Jun 2005 18:48:57 +0000 (GMT) (envelope-from sammy@lost-angel.com) Received: from [192.168.1.101] (pcp03356730pcs.midltn01.ct.comcast.net [68.54.121.110]) (authenticated bits=0) by orwell.lost-angel.com (8.13.3/8.13.1) with ESMTP id j5QImpSh080454 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NO); Sun, 26 Jun 2005 14:48:54 -0400 (EDT) (envelope-from sammy@lost-angel.com) Mime-Version: 1.0 (Apple Message framework v730) To: osa@FreeBSD.org Message-Id: <3C97545C-603F-4E32-8561-B70A906603C7@lost-angel.com> From: sammy!!! Date: Sun, 26 Jun 2005 14:48:44 -0400 X-Mailer: Apple Mail (2.730) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-ports@FreeBSD.org Subject: Patch for FreeBSD Port: misc/seq2 X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jun 2005 18:48:58 -0000 I can't seem to find the actual page for this project anymore, but this patch is very helpful to seq2 for making it countdown (useful in backups): cooper# diff main.c work/seq2-0.2/src/main.c 94c94 < } else if (end < start && increment > 0) { --- > } else if (end < start) { 98,99d97 < } else if (end > start && increment < 0) { < fprintf(stderr, "end is greater than start with negative increment. Exiting...\n"); cooper# diff prog.c work/seq2-0.2/src/prog.c 33c33 < if (increment > 0) --- > for(i=start; i <= end; i = i + increment) 35c35 < for(i=start; i <= end; i = i + increment) --- > if(text) 37c37 < if(text) --- > if (leadz == 1) 39,44c39 < if (leadz == 1) < { < fprintf(file, "%s %02d", text, i); < } else { < fprintf(file, "%s %d", text, i); < } --- > fprintf(file, "%s %02d", text, i); 46,51c41 < if (leadz == 1) < { < fprintf(file, "%02d ", i); < } else { < fprintf(file, "%d ", i); < } --- > fprintf(file, "%s %d", text, i); 53,54c43,44 < sleep(fastmode); < if(new_line == 1) --- > } else { > if (leadz == 1) 56c46,48 < fprintf(file, "\n"); --- > fprintf(file, "%02d ", i); > } else { > fprintf(file, "%d ", i); 59,60c51,52 < } else { < for(i=start; i >= end; i = i + increment) --- > sleep(fastmode); > if(new_line == 1) 62,82c54 < if(text) < { < if (leadz == 1) < { < fprintf(file, "%s %02d", text, i); < } else { < fprintf(file, "%s %d", text, i); < } < } else { < if (leadz == 1) < { < fprintf(file, "%02d ", i); < } else { < fprintf(file, "%d ", i); < } < } < sleep(fastmode); < if(new_line == 1) < { < fprintf(file, "\n"); < } --- > fprintf(file, "\n"); When running: seq2 -s 5 -i -1 -e 0 start is greater than end. Exiting... is no longer displayed, this is: 5 4 3 2 1 0