From owner-svn-ports-all@freebsd.org Sun Aug 19 14:38:09 2018 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3918106A81B; Sun, 19 Aug 2018 14:38:08 +0000 (UTC) (envelope-from pi@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 87F977944C; Sun, 19 Aug 2018 14:38:08 +0000 (UTC) (envelope-from pi@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 68B4E2790F; Sun, 19 Aug 2018 14:38:08 +0000 (UTC) (envelope-from pi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7JEc8VF059151; Sun, 19 Aug 2018 14:38:08 GMT (envelope-from pi@FreeBSD.org) Received: (from pi@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7JEc7Cw059148; Sun, 19 Aug 2018 14:38:07 GMT (envelope-from pi@FreeBSD.org) Message-Id: <201808191438.w7JEc7Cw059148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pi set sender to pi@FreeBSD.org using -f From: Kurt Jaeger Date: Sun, 19 Aug 2018 14:38:07 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r477579 - in head/math/sc-im: . files X-SVN-Group: ports-head X-SVN-Commit-Author: pi X-SVN-Commit-Paths: in head/math/sc-im: . files X-SVN-Commit-Revision: 477579 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.27 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, 19 Aug 2018 14:38:09 -0000 Author: pi Date: Sun Aug 19 14:38:07 2018 New Revision: 477579 URL: https://svnweb.freebsd.org/changeset/ports/477579 Log: math/sc-im: fix segmentation fault upon :wq - bug reported upstream as https://github.com/andmarti1424/sc-im/pull/280 PR: 227861 Submitted by: Samy Mahmoudi Approved by: bapt (maintainer timeout) Added: head/math/sc-im/files/ head/math/sc-im/files/patch-cmds__command.c (contents, props changed) head/math/sc-im/files/patch-doc (contents, props changed) head/math/sc-im/files/patch-file.c (contents, props changed) Modified: head/math/sc-im/Makefile Modified: head/math/sc-im/Makefile ============================================================================== --- head/math/sc-im/Makefile Sun Aug 19 14:26:10 2018 (r477578) +++ head/math/sc-im/Makefile Sun Aug 19 14:38:07 2018 (r477579) @@ -1,9 +1,10 @@ # $FreeBSD$ -PORTNAME= sc-im -PORTVERSION= 0.7.0 +PORTNAME= sc-im +PORTVERSION= 0.7.0 DISTVERSIONPREFIX= v -CATEGORIES= math +PORTREVISION= 1 +CATEGORIES= math MAINTAINER= bapt@FreeBSD.org COMMENT= Ncurses spreadsheet program for terminal Added: head/math/sc-im/files/patch-cmds__command.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/math/sc-im/files/patch-cmds__command.c Sun Aug 19 14:38:07 2018 (r477579) @@ -0,0 +1,11 @@ +--- cmds_command.c.orig 2018-08-03 06:04:39 UTC ++++ cmds_command.c +@@ -826,7 +826,7 @@ void do_commandmode(struct block * sb) { + exec_cmd(line); + + } else if ( inputline[0] == L'w' ) { +- if (savefile() == 0 && ! wcscmp(inputline, L"wq")) shall_quit = 1; ++ if (savefile() == 0 && ! wcsncmp(inputline, L"wq", 2)) shall_quit = 1; + + } else if ( ! wcsncmp(inputline, L"file ", 5) ) { + Added: head/math/sc-im/files/patch-doc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/math/sc-im/files/patch-doc Sun Aug 19 14:38:07 2018 (r477579) @@ -0,0 +1,11 @@ +--- doc.orig 2018-08-03 06:09:42 UTC ++++ doc +@@ -328,6 +328,8 @@ Commands for handling cell content: + :w {file} Save the current spreadsheet as {file}. + :w! {file} Save the current spreadsheet as {file}, forcing an overwrite + if {file} already exists. ++ :wq Save the current spreadsheet and quit SC-IM. ++ :wq {file} Save the current spreadsheet as {file} and quit SC-IM. + + :h Show this help. + :help Show this help. Added: head/math/sc-im/files/patch-file.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/math/sc-im/files/patch-file.c Sun Aug 19 14:38:07 2018 (r477579) @@ -0,0 +1,16 @@ +--- file.c.orig 2017-12-13 17:48:59 UTC ++++ file.c +@@ -202,7 +202,12 @@ int savefile() { + del_range_chars(name, 0, 1 + force_rewrite); + wordexp(name, &p, 0); + +- if (! force_rewrite && p.we_wordv[0] && file_exists(p.we_wordv[0])) { ++ if (wcslen(inputline) > 2 && (!p.we_wordv || !p.we_wordv[0])) { ++ sc_error("Trailing space(s)"); ++ return -1; ++ } ++ ++ if (! force_rewrite && p.we_wordv && p.we_wordv[0] && file_exists(p.we_wordv[0])) { + sc_error("File already exists. Use \"!\" to force rewrite."); + wordfree(&p); + return -1;