From owner-svn-ports-head@freebsd.org Wed May 11 20:59:41 2016 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 293A5B37D32; Wed, 11 May 2016 20:59:41 +0000 (UTC) (envelope-from bapt@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 mx1.freebsd.org (Postfix) with ESMTPS id 042301A86; Wed, 11 May 2016 20:59:40 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BKxeJd012727; Wed, 11 May 2016 20:59:40 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BKxeAo012726; Wed, 11 May 2016 20:59:40 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201605112059.u4BKxeAo012726@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 11 May 2016 20:59:40 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r415033 - head/games/xpilot/files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 May 2016 20:59:41 -0000 Author: bapt Date: Wed May 11 20:59:39 2016 New Revision: 415033 URL: https://svnweb.freebsd.org/changeset/ports/415033 Log: Prevent collision with getline(3) Added: head/games/xpilot/files/patch-src_client_textinterface.c (contents, props changed) Added: head/games/xpilot/files/patch-src_client_textinterface.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/games/xpilot/files/patch-src_client_textinterface.c Wed May 11 20:59:39 2016 (r415033) @@ -0,0 +1,92 @@ +--- src/client/textinterface.c.orig 2010-02-21 15:59:29 UTC ++++ src/client/textinterface.c +@@ -75,7 +75,7 @@ extern char hostname[]; /* my local ho + /* + * just like fgets() but strips newlines like gets(). + */ +-static char* getline(char* buf, int len, FILE* stream) ++static char* get_line(char* buf, int len, FILE* stream) + { + char *nl; + +@@ -305,7 +305,7 @@ static bool Process_commands(sockbuf_t * + else if (!auto_connect) { + printf("*** Server on %s. Enter command> ", conpar->server_name); + +- getline(linebuf, MAX_LINE-1, stdin); ++ get_line(linebuf, MAX_LINE-1, stdin); + if (feof(stdin)) { + puts(""); + c = 'Q'; +@@ -385,7 +385,7 @@ static bool Process_commands(sockbuf_t * + case 'K': + printf("Enter name of victim: "); + fflush(stdout); +- if (!getline(linebuf, MAX_LINE-1, stdin)) { ++ if (!get_line(linebuf, MAX_LINE-1, stdin)) { + printf("Nothing changed.\n"); + continue; + } +@@ -396,7 +396,7 @@ static bool Process_commands(sockbuf_t * + case 'R': + printf("Enter maximum number of robots: "); + fflush(stdout); +- if (!getline(linebuf, MAX_LINE-1, stdin)) { ++ if (!get_line(linebuf, MAX_LINE-1, stdin)) { + printf("Nothing changed.\n"); + continue; + } +@@ -410,7 +410,7 @@ static bool Process_commands(sockbuf_t * + case 'M': /* Send a message to server. */ + printf("Enter message: "); + fflush(stdout); +- if (!getline(linebuf, MAX_LINE-1, stdin) || !linebuf[0]) { ++ if (!get_line(linebuf, MAX_LINE-1, stdin) || !linebuf[0]) { + printf("No message sent.\n"); + continue; + } +@@ -425,7 +425,7 @@ static bool Process_commands(sockbuf_t * + case 'D': /* Shutdown */ + if (!auto_shutdown) { + printf("Enter delay in seconds or return for cancel: "); +- getline(linebuf, MAX_LINE-1, stdin); ++ get_line(linebuf, MAX_LINE-1, stdin); + /* + * No argument = cancel shutdown = arg_int=0 + */ +@@ -436,7 +436,7 @@ static bool Process_commands(sockbuf_t * + delay = 1; + + printf("Enter reason: "); +- getline(linebuf, MAX_LINE-1, stdin); ++ get_line(linebuf, MAX_LINE-1, stdin); + } else { + strlcpy(linebuf, shutdown_reason, sizeof(linebuf)); + delay = 60; +@@ -448,7 +448,7 @@ static bool Process_commands(sockbuf_t * + case 'O': /* Tune an option. */ + printf("Enter option: "); + fflush(stdout); +- if (!getline(linebuf, MAX_LINE-1, stdin) ++ if (!get_line(linebuf, MAX_LINE-1, stdin) + || (len=strlen(linebuf)) == 0) { + printf("Nothing changed.\n"); + continue; +@@ -456,7 +456,7 @@ static bool Process_commands(sockbuf_t * + printf("Enter new value for %s: ", linebuf); + fflush(stdout); + strcat(linebuf, ":"); len++; +- if (!getline(&linebuf[len], MAX_LINE-1-len, stdin) ++ if (!get_line(&linebuf[len], MAX_LINE-1-len, stdin) + || linebuf[len] == '\0') { + printf("Nothing changed.\n"); + continue; +@@ -516,7 +516,7 @@ static bool Process_commands(sockbuf_t * + case 'T': /* Set team. */ + printf("Enter team: "); + fflush(stdout); +- if (!getline(linebuf, MAX_LINE-1, stdin) ++ if (!get_line(linebuf, MAX_LINE-1, stdin) + || (len = strlen(linebuf)) == 0) { + printf("Nothing changed.\n"); + }