mirror of
https://git.freebsd.org/ports.git
synced 2025-07-18 01:39:16 -04:00
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.
This commit is contained in:
parent
759b69bb6b
commit
e0e4186db9
3 changed files with 64 additions and 10 deletions
|
@ -1,9 +1,9 @@
|
||||||
PORTNAME= diamond
|
PORTNAME= diamond
|
||||||
DISTVERSIONPREFIX= diamond-
|
DISTVERSION= 1.3.7
|
||||||
DISTVERSION= 1.3.6
|
DISTNAME= Diamond-${DISTVERSION}
|
||||||
PORTREVISION= 1
|
|
||||||
CATEGORIES= editors
|
CATEGORIES= editors
|
||||||
PKGNAMESUFFIX= -cs
|
PKGNAMESUFFIX= -cs
|
||||||
|
MASTER_SITES= https://download.copperspice.com/${PORTNAME}/source/
|
||||||
|
|
||||||
MAINTAINER= adridg@FreeBSD.org
|
MAINTAINER= adridg@FreeBSD.org
|
||||||
COMMENT= Compact programmers editor
|
COMMENT= Compact programmers editor
|
||||||
|
@ -15,13 +15,20 @@ LIB_DEPENDS= libhunspell-1.7.so:textproc/hunspell
|
||||||
BUILD_DEPENDS= copperspice>=1.7:x11-toolkits/copperspice
|
BUILD_DEPENDS= copperspice>=1.7:x11-toolkits/copperspice
|
||||||
RUN_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_GL= gl
|
||||||
USE_GNOME= cairo glib20 libxml2
|
USE_GNOME= cairo glib20 libxml2
|
||||||
USE_XORG= ice sm x11 xau xcb xcursor xext xfixes xi xinerama xrandr xrender
|
USE_XORG= ice sm x11 xau xcb xcursor xext xfixes xi xinerama xrandr xrender
|
||||||
|
|
||||||
USE_GITHUB= yes
|
# It's a bit up-in-the-air if the GitHub tarballs are less fragile
|
||||||
GH_ACCOUNT= copperspice
|
# than the upstream source tarballs, which have their own peculiarities
|
||||||
GH_PROJECT= diamond
|
# (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 <bsd.port.mk>
|
.include <bsd.port.mk>
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
TIMESTAMP = 1645301383
|
TIMESTAMP = 1646082059
|
||||||
SHA256 (copperspice-diamond-diamond-1.3.6_GH0.tar.gz) = e1b85890a870236370207c5d6b7aa7d44d7414a090723ecea513f8b5cec4fb67
|
SHA256 (Diamond-1.3.7.tar.bz2) = 1b104df02b0f4dd9debc9286776d7c202bcda64cb84d3cb2b20b161e34e918f1
|
||||||
SIZE (copperspice-diamond-diamond-1.3.6_GH0.tar.gz) = 4626624
|
SIZE (Diamond-1.3.7.tar.bz2) = 4629796
|
||||||
|
|
|
@ -0,0 +1,47 @@
|
||||||
|
From e8f0d274471cf0a50a78aec102ffa87541887f2e Mon Sep 17 00:00:00 2001
|
||||||
|
From: Adriaan de Groot <groot@kde.org>
|
||||||
|
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();
|
Loading…
Add table
Reference in a new issue