Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Jun 2009 22:37:22 -0500 (CDT)
From:      "Matthew D. Fuller" <fullermd@over-yonder.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/136060: [PATCH] Some bugfixes for match/physcalc
Message-ID:  <20090626033722.16CE061C52@draco.over-yonder.net>
Resent-Message-ID: <200906260340.n5Q3e11b025940@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         136060
>Category:       ports
>Synopsis:       [PATCH] Some bugfixes for match/physcalc
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jun 26 03:40:01 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Matthew D. Fuller
>Release:        FreeBSD 7.1-STABLE i386
>Organization:
>Environment:
System: FreeBSD draco.over-yonder.net 7.1-STABLE FreeBSD 7.1-STABLE #0: Tue Feb 17 18:07:44 CST 2009 root@draco.over-yonder.net:/bsd/obj/bsd/src/sys/DRACO i386


	
>Description:
	Several problems in physcalc are addressed.

	1) The path to the .phy files was built up using un-zero'd memory, so
	   it could (and did, for me) break in strange and unexpected ways.

	2) EOF on input (e.g., ^D) would cause it to loop forever.

>How-To-Repeat:
	
>Fix:


Index: Makefile
===================================================================
RCS file: /draco/cvs/ports/math/physcalc/Makefile,v
retrieving revision 1.9
diff -u -r1.9 Makefile
--- Makefile	10 May 2006 22:37:11 -0000	1.9
+++ Makefile	26 Jun 2009 03:23:54 -0000
@@ -7,6 +7,7 @@
 
 PORTNAME=	physcalc
 PORTVERSION=	2.4
+PORTREVISION=	1
 CATEGORIES=	math
 MASTER_SITES=	ftp://ftp.lightlink.com/pub/vulcan/
 DISTNAME=	${PORTNAME}
Index: files/patch-ab
===================================================================
RCS file: /draco/cvs/ports/math/physcalc/files/patch-ab,v
retrieving revision 1.1
diff -u -r1.1 patch-ab
--- files/patch-ab	27 Aug 2000 23:32:03 -0000	1.1
+++ files/patch-ab	26 Jun 2009 03:23:40 -0000
@@ -1,5 +1,5 @@
---- physconv.c	Sun Aug 27 17:57:24 2000
-+++ physconv.c.new	Sun Aug 27 18:03:58 2000
+--- physconv.c.orig	1998-08-30 15:58:16.000000000 -0500
++++ physconv.c	2009-06-25 22:22:21.000000000 -0500
 @@ -260,12 +260,16 @@
  {	/* read in lines from fp and do each as if typed from console */
  	FILE *fp;
@@ -11,7 +11,7 @@
  #endif
  
 -	if ((fp = fopen(s,"r"))==NULL) {
-+	fullpath = malloc( strlen( SHAREDIR ) + strlen( s ) + 1 );
++	fullpath = calloc( strlen( SHAREDIR ) + strlen( s ) + 1, 1 );
 +	bcopy(SHAREDIR, fullpath, strlen(SHAREDIR));
 +	(void) strcat(fullpath, s);
 +	if ((fp = fopen(fullpath,"r"))==NULL) {
Index: files/patch-ac
===================================================================
RCS file: /draco/cvs/ports/math/physcalc/files/patch-ac,v
retrieving revision 1.1
diff -u -r1.1 patch-ac
--- files/patch-ac	27 Aug 2000 23:32:03 -0000	1.1
+++ files/patch-ac	26 Jun 2009 03:33:01 -0000
@@ -1,5 +1,5 @@
---- physmain.c	Sun Aug 27 17:55:04 2000
-+++ physmain.c.new	Sun Aug 27 17:55:53 2000
+--- physmain.c.orig	1998-08-30 14:48:34.000000000 -0500
++++ physmain.c	2009-06-25 22:32:46.000000000 -0500
 @@ -227,7 +227,7 @@
  				printf("Replace %s = ",v->name);
  				printexpr(v->value);
@@ -9,12 +9,13 @@
  				printf("\n");
  			} else
  				answer[0] = 'Y';
-@@ -711,7 +711,7 @@
+@@ -711,7 +711,8 @@
  	} else
  		while (TRUE) {
  			printf(">");
 -			gets(buf);
-+			fgets(buf, sizeof(buf), stdin);
++			if(fgets(buf, sizeof(buf), stdin) == NULL)
++				exit(0);
  			do_cmd(buf);
  		}
  }

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090626033722.16CE061C52>