From nobody Tue Mar 01 10:42:49 2022 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 5DFCE19F5727; Tue, 1 Mar 2022 10:42:49 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4K7DNT294Bz4V1V; Tue, 1 Mar 2022 10:42:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646131369; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XpcOxX7ir5ImVaFDjmwE7ZW3qT+f6cNH17jVpEug4tg=; b=L+0tWDURm9kZwUEZZsnX7DkN647780lB6LldUpA4y15gZLwnuETUVpcpCtfNK8sQ6SowVA YNC4XL5mrvAxVB1J3PjE+/yO4PPLvHTGrRtyO7QRvY+JbCoyQrT0jSEzIs+W+pchU6ukCp /+Rs2F9zer9fKyqj6NLP8BbVQTvGIxLfM6RmuC+/GDIsSqewU8GoS7eYcRHQrGeK0OyQOr EBRc0lA01OdJRjRBzAYgac7mFMmCaMkZ6g1XXuoG168js3GnrzrrAMM/h98s2VqYYM/CNp pRLzVsRRQ03u39L+a+3lmPMhlcZtaXbdYc+a+I+HzwjQ+dkMvwuSXguZf+XpAw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A75261B1; Tue, 1 Mar 2022 10:42:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 221AgnlP030177; Tue, 1 Mar 2022 10:42:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 221AgnET030176; Tue, 1 Mar 2022 10:42:49 GMT (envelope-from git) Date: Tue, 1 Mar 2022 10:42:49 GMT Message-Id: <202203011042.221AgnET030176@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Adriaan de Groot Subject: git: e0e4186db92b - main - editors/diamond: update to 1.3.7, latest upstream List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adridg X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e0e4186db92be75489f6979af6da9aa1808cba1c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646131369; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XpcOxX7ir5ImVaFDjmwE7ZW3qT+f6cNH17jVpEug4tg=; b=HCH2P1UjupoO/CXYQt3C8FB1YkpmYqNjmG08vSlyhlR6lHEW7Z8URWOgivekMuRCgx2SGi XPXwVPhId23R1ihCKXIm1v5F0itIOiSgafWQy506rRUwy0EBEGeqruTCikstYXzFGMQjIE R/Ik20uvxFZhVXJ9Cyw7zuPB1AVaWFxtxRcujvVR+9983qs0J0QwMsVS+FB4tUmKbgu5q8 9Z8Hg2Bq/8CLj5sPTd70L9FM8xTYTwe2SHU/JZyU/vO8i8FSkuIJ8f4DojX0meT0NIQ/gF pPrb8tNwHoyNuzIZ5hWbsg0+LihE8LFG6h/FGpZZUB5FbW7KsJJ+VWh48Qgolg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1646131369; a=rsa-sha256; cv=none; b=qZkBMT20pnccEmjK6vG9llvsb8RvWSuUJqJi0js8AD5JRDTYdEiUCF4jaMBshktBWNLRy/ ZYgZ8t8/oraQNug4slRIGwj/PnuttAK/e2AAayHMoPeSnQ+b870Z6fWpXxfLASYZhBzzF0 EzSa2ujwpaFnINW8B1M5EKTRGQE9jnMDev1UPxDtpsb+7ICeXiCqO1lr7Qx9nvkUT03Mjk vS17Aa/dR9I0tw7rNteLFWb7z9xj5uNzEeDwRK+/LqGeQTjuMlzSXzhSR9TgJ7fuLBgt+e WaxsensWXB5YVX9ojswdfiIeoGAi0yFWkU6Iesp86/eyDPgNGTyCVcY3HlBu/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by adridg: URL: https://cgit.FreeBSD.org/ports/commit/?id=e0e4186db92be75489f6979af6da9aa1808cba1c commit e0e4186db92be75489f6979af6da9aa1808cba1c Author: Adriaan de Groot AuthorDate: 2022-03-01 10:17:16 +0000 Commit: Adriaan de Groot CommitDate: 2022-03-01 10:42:47 +0000 editors/diamond: update to 1.3.7, latest upstream This version is just a copyright-year update. I'm taking advantage to follow Daniel Engberg's advice to use the upstream tarballs rather than GitHub tarballs, even though the upstream tarballs are, IMO, terrible. While here, pull in a patch I wrote to avoid crashes on startup. --- editors/diamond/Makefile | 21 ++++++---- editors/diamond/distinfo | 6 +-- ...-e8f0d274471cf0a50a78aec102ffa87541887f2e.patch | 47 ++++++++++++++++++++++ 3 files changed, 64 insertions(+), 10 deletions(-) diff --git a/editors/diamond/Makefile b/editors/diamond/Makefile index 58562eaf6d2c..e36385cee66a 100644 --- a/editors/diamond/Makefile +++ b/editors/diamond/Makefile @@ -1,9 +1,9 @@ PORTNAME= diamond -DISTVERSIONPREFIX= diamond- -DISTVERSION= 1.3.6 -PORTREVISION= 1 +DISTVERSION= 1.3.7 +DISTNAME= Diamond-${DISTVERSION} CATEGORIES= editors PKGNAMESUFFIX= -cs +MASTER_SITES= https://download.copperspice.com/${PORTNAME}/source/ MAINTAINER= adridg@FreeBSD.org COMMENT= Compact programmers editor @@ -15,13 +15,20 @@ LIB_DEPENDS= libhunspell-1.7.so:textproc/hunspell BUILD_DEPENDS= copperspice>=1.7:x11-toolkits/copperspice RUN_DEPENDS= copperspice>=1.7:x11-toolkits/copperspice -USES= compiler:c++17-lang cmake gl gnome iconv jpeg pkgconfig ssl xorg +USES= compiler:c++17-lang cmake dos2unix gl gnome iconv jpeg pkgconfig ssl tar:bz2 xorg USE_GL= gl USE_GNOME= cairo glib20 libxml2 USE_XORG= ice sm x11 xau xcb xcursor xext xfixes xi xinerama xrandr xrender -USE_GITHUB= yes -GH_ACCOUNT= copperspice -GH_PROJECT= diamond +# It's a bit up-in-the-air if the GitHub tarballs are less fragile +# than the upstream source tarballs, which have their own peculiarities +# (e.g. CRLF, no subdir). We dos2unix the files that need patching. +# +# USE_GITHUB= yes +# GH_ACCOUNT= copperspice +# GH_PROJECT= diamond +# +NO_WRKSUBDIR= yes +DOS2UNIX_FILES= CMakeLists.txt src/CMakeLists.txt src/json.cpp src/recent_tabs.cpp .include diff --git a/editors/diamond/distinfo b/editors/diamond/distinfo index d907474b1d5a..ce6e462b4c0d 100644 --- a/editors/diamond/distinfo +++ b/editors/diamond/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1645301383 -SHA256 (copperspice-diamond-diamond-1.3.6_GH0.tar.gz) = e1b85890a870236370207c5d6b7aa7d44d7414a090723ecea513f8b5cec4fb67 -SIZE (copperspice-diamond-diamond-1.3.6_GH0.tar.gz) = 4626624 +TIMESTAMP = 1646082059 +SHA256 (Diamond-1.3.7.tar.bz2) = 1b104df02b0f4dd9debc9286776d7c202bcda64cb84d3cb2b20b161e34e918f1 +SIZE (Diamond-1.3.7.tar.bz2) = 4629796 diff --git a/editors/diamond/files/patch-e8f0d274471cf0a50a78aec102ffa87541887f2e.patch b/editors/diamond/files/patch-e8f0d274471cf0a50a78aec102ffa87541887f2e.patch new file mode 100644 index 000000000000..52ae0371df30 --- /dev/null +++ b/editors/diamond/files/patch-e8f0d274471cf0a50a78aec102ffa87541887f2e.patch @@ -0,0 +1,47 @@ +From e8f0d274471cf0a50a78aec102ffa87541887f2e Mon Sep 17 00:00:00 2001 +From: Adriaan de Groot +Date: Sun, 20 Feb 2022 16:23:53 +0100 +Subject: [PATCH] Fix crash when passing filenames on command-line + +Consider running `diamond file.txt`. If previously there +was an untitled tab open and nothing else, we arrive +here with 2 tabs, `cnt==2`. The first for-loop finds +an untitled tab at index `k==0` and decrements `cnt`, +then the for-loop increments `k` and the for-loop terminates +(because `1 < 1` is false). We have `cnt==1` but an **empty** +list `m_openedFiles`. This crashes with an out-of-bounds access +in the second for-loop, because `cnt` doesn't match the length +of the list anymore. + +As a fix: +- do not modify `cnt` in the first for-loop, always check + all of the current tabs, +- re-calculate the `cnt` based on the files that are actually + opened, before the second loop. +--- + src/recent_tabs.cpp | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +diff --git a/src/recent_tabs.cpp b/src/recent_tabs.cpp +index b3359ac..3eef680 100644 +--- src/recent_tabs.cpp ++++ src/recent_tabs.cpp +@@ -31,15 +31,13 @@ void MainWindow::openTab_CreateMenus() + for (int k = 0; k < cnt; ++k) { + fullName = this->get_curFileName(k); + +- if (fullName.isEmpty()) { +- --cnt; +- +- } else { ++ if (!fullName.isEmpty()) { + m_openedFiles.append(fullName); + m_openedModified.append(false); + } + } +- ++ // How many were really opened ++ cnt = m_openedFiles.count(); + // + QMenu *windowMenu = m_ui->menuWindow; + windowMenu->addSeparator();