From owner-svn-ports-all@freebsd.org Sun Sep 1 16:40:06 2019 Return-Path: Delivered-To: svn-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DF01BDE572; Sun, 1 Sep 2019 16:40:06 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46LzTf5ck2z4VRk; Sun, 1 Sep 2019 16:40:06 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A4AF045A7; Sun, 1 Sep 2019 16:40:06 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x81Ge6V7010248; Sun, 1 Sep 2019 16:40:06 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x81Ge6Dp010246; Sun, 1 Sep 2019 16:40:06 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201909011640.x81Ge6Dp010246@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Sun, 1 Sep 2019 16:40:06 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r510707 - in head/biology/recombine: . files X-SVN-Group: ports-head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: in head/biology/recombine: . files X-SVN-Commit-Revision: 510707 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Sep 2019 16:40:06 -0000 Author: lwhsu Date: Sun Sep 1 16:40:06 2019 New Revision: 510707 URL: https://svnweb.freebsd.org/changeset/ports/510707 Log: Add a patch to remove use of gets(3) PR: 238685 Submitted by: Walter Schwarzenfeld Reported by: emaste Sponsored by: The FreeBSD Foundation Added: head/biology/recombine/files/patch-recombine.c (contents, props changed) Modified: head/biology/recombine/Makefile Modified: head/biology/recombine/Makefile ============================================================================== --- head/biology/recombine/Makefile Sun Sep 1 16:21:26 2019 (r510706) +++ head/biology/recombine/Makefile Sun Sep 1 16:40:06 2019 (r510707) @@ -3,6 +3,7 @@ PORTNAME= recombine PORTVERSION= 1.41 +PORTREVISION= 1 CATEGORIES= biology MASTER_SITES= http://evolution.gs.washington.edu/lamarc/recombine/ DISTNAME= ${PORTNAME}${PORTVERSION}.src.doc Added: head/biology/recombine/files/patch-recombine.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/biology/recombine/files/patch-recombine.c Sun Sep 1 16:40:06 2019 (r510707) @@ -0,0 +1,168 @@ +--- recombine.c.orig 2019-08-03 09:14:33 UTC ++++ recombine.c +@@ -169,7 +169,7 @@ void openfile(FILE **fp, char *filename, + file[0] = '\0'; + while (file[0] =='\0'){ + fprintf(stdout,"Please enter a new filename>"); +- gets(file); ++ fgets(file,100,stdin); + } + break; + case 'w': +@@ -177,7 +177,7 @@ void openfile(FILE **fp, char *filename, + file[0] = '\0'; + while (file[0] =='\0'){ + fprintf(stdout,"Please enter a new filename>"); +- gets(file); ++ fgets(file,100,stdin); + } + break; + } +@@ -1864,28 +1864,28 @@ if (strchr("#FLAHONESPGUMVRTD",ch) != NU + case 'R': + do { + printf("Relative mutation rate of trait?\n"); +- gets(input); ++ fgets(input,LINESIZE,stdin); + op->mutrait = atof(input); + } while (op->mutrait <= 0.0); + break; + case 'T': + do { + printf("Ratio of forward to back trait mutation?\n"); +- gets(input); ++ fgets(input,LINESIZE,stdin); + op->traitratio = atof(input); + } while (op->traitratio <= 0.0); + break; + case 'D': + do { + printf("Frequency of trait?\n"); +- gets(input); ++ fgets(input,LINESIZE,stdin); + op->pd = atof(input); + } while (op->pd <= 0.0 || op->pd >= 1.0); + break; + case 'A': + do { + printf("Number of drops while resimulating (0-2)?\n"); +- gets(input); ++ fgets(input,LINESIZE,stdin); + op->hapdrop = atol(input); + } while (op->hapdrop != 0 && op->hapdrop != 1 && op->hapdrop != 2); + default: +@@ -1972,7 +1972,7 @@ if(strchr("#NQPDITFCRVHWZS12L34AB",ch) ! + case 'T': + do { + printf("Transition/transversion ratio?\n"); +- gets(input); ++ fgets(input,LINESIZE,stdin); + locus_ttratio = atof(input); + if (locus_ttratio < 0.5) + printf("TTratio cannot be less than 0.5\n"); +@@ -1991,13 +1991,13 @@ if(strchr("#NQPDITFCRVHWZS12L34AB",ch) ! + op->panel = !op->panel; + if (op->panel) { + printf("Number of populations?\n"); +- gets(input); ++ ; + *numpop = atol(input); + op->numpanel = (long *)calloc(*numpop,sizeof(long)); + for(i = 0; i < *numpop; i++) { + printf("Number of panel haplotypes for population"); + printf(" %ld?\n",i+1); +- gets(input); ++ fgets(input,LINESIZE,stdin); + op->numpanel[i] = atol(input); + } + } else +@@ -2012,7 +2012,7 @@ if(strchr("#NQPDITFCRVHWZS12L34AB",ch) ! + if (op->ctgry) { + do { + printf("Number of categories ?"); +- gets(input); ++ fgets(input,LINESIZE,stdin); + op->categs = atoi(input); + } while (op->categs < 1); + free(op->rate); +@@ -2091,7 +2091,7 @@ if(strchr("#NQPDITFCRVHWZS12L34AB",ch) ! + if (!op->watt) { + do { + printf("Initial theta estimate?\n"); +- gets(input); ++ fgets(input,LINESIZE,stdin); + theta0 = atof(input); + } while (theta0 <= 0.0); + } +@@ -2099,7 +2099,7 @@ if(strchr("#NQPDITFCRVHWZS12L34AB",ch) ! + case 'Z': + printf("What recombination rate?\n"); + do { +- gets(input); ++ fgets(input,LINESIZE,stdin); + rec0 = atof(input); + if (rec0 < 0.0) + printf("recombination rate must be non-negative\n"); +@@ -2108,7 +2108,7 @@ if(strchr("#NQPDITFCRVHWZS12L34AB",ch) ! + case 'S': + do { + printf("How many Short Chains?\n"); +- gets(input); ++ fgets(input,LINESIZE,stdin); + op->numchains[0] = atoi(input); + if (op->numchains[0] < 0) + printf("Must be non-negative\n"); +@@ -2118,7 +2118,7 @@ if(strchr("#NQPDITFCRVHWZS12L34AB",ch) ! + done = FALSE; + while (!done) { + printf("How often to sample trees?\n"); +- gets(input); ++ fgets(input,LINESIZE,stdin); + op->increm[0] = atoi(input); + if (op->increm[0] > 0) done = TRUE; + else printf("Must be a positive integer\n"); +@@ -2128,7 +2128,7 @@ if(strchr("#NQPDITFCRVHWZS12L34AB",ch) ! + done = FALSE; + while (!done) { + printf("How many short steps?\n"); +- gets(input); ++ fgets(input,LINESIZE,stdin); + op->steps[0] = atoi(input); + if (op->steps[0] > 0) done = TRUE; + else printf("Must be a positive integer\n"); +@@ -2137,7 +2137,7 @@ if(strchr("#NQPDITFCRVHWZS12L34AB",ch) ! + case 'L': + do { + printf("How many Long Chains?\n"); +- gets(input); ++ fgets(input,LINESIZE,stdin); + op->numchains[1] = atoi(input); + if (op->numchains[1] < 1) + printf("Must be a positive integer\n"); +@@ -2147,7 +2147,7 @@ if(strchr("#NQPDITFCRVHWZS12L34AB",ch) ! + done = FALSE; + while (!done) { + printf("How often to sample trees?\n"); +- gets(input); ++ fgets(input,LINESIZE,stdin); + op->increm[1] = atoi(input); + if (op->increm[1] > 0) done = TRUE; + else printf("Must be a positive integer\n"); +@@ -2157,7 +2157,7 @@ if(strchr("#NQPDITFCRVHWZS12L34AB",ch) ! + done = FALSE; + while (!done) { + printf("How many long steps?\n"); +- gets(input); ++ fgets(input,LINESIZE,stdin); + op->steps[1] = atoi(input); + if (op->steps[1] > 0) done = TRUE; + else printf("Must be a positive integer\n"); +@@ -2239,7 +2239,7 @@ do { + if (menu1) print_startmenu(op,writeout); + else {print_datamenu(op); print_searchmenu(op);} + print_menuend(); +- gets(input); ++ fgets(input,LINESIZE,stdin); + ch = toupper((int)input[0]); + done = (ch == 'Y'); + if (!done) {