pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/sysutils/tkdesk



Module Name:    pkgsrc
Committed By:   dholland
Date:           Mon Jun  6 05:11:59 UTC 2022

Modified Files:
        pkgsrc/sysutils/tkdesk: Makefile distinfo
        pkgsrc/sysutils/tkdesk/patches: patch-aa patch-aj patch-al
Added Files:
        pkgsrc/sysutils/tkdesk/patches: patch-libdesk_dsk__ls.c
            patch-libdesk_misc.c patch-libdesk_o__FileListbox.c
            patch-libdesk_ot.c patch-netscape-remote_netscape-remote.c

Log Message:
Fix up sysutils/tkdesk, some.

 - Fix up the TCL interpreter result handling so we don't need to use
   USE_INTERP_RESULT.

 - Fix the first startup segfault (probably the one seen in PR 32807
   but not necessarily) by using Tcl_Free instead of trying to bypass
   it. Unfortunately, there's at least one more segfault at startup
   with no obvious cause.

 - Don't run off the end of string buffers.

 - Remove some uses of sprintf. Use standard headers. Other minor
   tidyups.

 - Correct glitch in the configury patches that made it link
   statically to blt.

 - Avoid passing empty variable names to test(1) during configure.

 - Fix some pkglint.

Bump PKGREVISION to 4, because even though it didn't run and still
doesn't, it does build. :-|


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 pkgsrc/sysutils/tkdesk/Makefile
cvs rdiff -u -r1.11 -r1.12 pkgsrc/sysutils/tkdesk/distinfo
cvs rdiff -u -r1.3 -r1.4 pkgsrc/sysutils/tkdesk/patches/patch-aa
cvs rdiff -u -r1.4 -r1.5 pkgsrc/sysutils/tkdesk/patches/patch-aj
cvs rdiff -u -r1.1 -r1.2 pkgsrc/sysutils/tkdesk/patches/patch-al
cvs rdiff -u -r0 -r1.1 pkgsrc/sysutils/tkdesk/patches/patch-libdesk_dsk__ls.c \
    pkgsrc/sysutils/tkdesk/patches/patch-libdesk_misc.c \
    pkgsrc/sysutils/tkdesk/patches/patch-libdesk_o__FileListbox.c \
    pkgsrc/sysutils/tkdesk/patches/patch-libdesk_ot.c \
    pkgsrc/sysutils/tkdesk/patches/patch-netscape-remote_netscape-remote.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/sysutils/tkdesk/Makefile
diff -u pkgsrc/sysutils/tkdesk/Makefile:1.30 pkgsrc/sysutils/tkdesk/Makefile:1.31
--- pkgsrc/sysutils/tkdesk/Makefile:1.30        Mon Aug 17 20:20:09 2020
+++ pkgsrc/sysutils/tkdesk/Makefile     Mon Jun  6 05:11:58 2022
@@ -1,31 +1,29 @@
-# $NetBSD: Makefile,v 1.30 2020/08/17 20:20:09 leot Exp $
+# $NetBSD: Makefile,v 1.31 2022/06/06 05:11:58 dholland Exp $
 #
 
 DISTNAME=      tkdesk-2.0
 PKGNAME=       ${DISTNAME}p2
-PKGREVISION=   3
+PKGREVISION=   5
 CATEGORIES=    sysutils
 MASTER_SITES=  http://tkdesk.sourceforge.net/dist/
 
+PATCH_SITES=           http://tkdesk.sourceforge.net/patches/
+PATCHFILES=            ${DISTNAME}p1.patch ${DISTNAME}p2.patch
+PATCH_DIST_STRIP=      -p1
+
 MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
 HOMEPAGE=      http://tkdesk.sourceforge.net/
 COMMENT=       Graphical file manager
 
-PATCHFILES=            ${DISTNAME}p1.patch ${DISTNAME}p2.patch
-PATCH_DIST_STRIP=      -p1
-PATCH_SITES=           http://tkdesk.sourceforge.net/patches/
-
 USE_TOOLS+=    pax
 
 GNU_CONFIGURE=         YES
 CONFIGURE_ARGS+=       --with-tcl=${BUILDLINK_PREFIX.tcl}/lib  \
                        --with-tk=${BUILDLINK_PREFIX.tk}/lib    \
-                       --with-itcl=${BUILDLINK_PREFIX.tcl}/lib/itcl${ITCL_VERSION}     \
+                       --with-itcl=${BUILDLINK_PREFIX.tcl}/lib/itcl${ITCL_VERSION} \
                        --with-blt=${BUILDLINK_PREFIX.blt}/lib
 MAKE_ENV+=             LIB_RUNTIME_DIR=${BUILDLINK_PREFIX.tcl}/lib/itcl${ITCL_VERSION}
 
-CFLAGS+=       -DUSE_INTERP_RESULT
-
 DESTDIR_VARNAME=       INSTALL_ROOT
 INSTALLATION_DIRS+=    bin ${PKGMANDIR}/man1
 

Index: pkgsrc/sysutils/tkdesk/distinfo
diff -u pkgsrc/sysutils/tkdesk/distinfo:1.11 pkgsrc/sysutils/tkdesk/distinfo:1.12
--- pkgsrc/sysutils/tkdesk/distinfo:1.11        Tue Oct 26 11:20:18 2021
+++ pkgsrc/sysutils/tkdesk/distinfo     Mon Jun  6 05:11:58 2022
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.11 2021/10/26 11:20:18 nia Exp $
+$NetBSD: distinfo,v 1.12 2022/06/06 05:11:58 dholland Exp $
 
 BLAKE2s (tkdesk-2.0.tar.gz) = 95b665597f1700fbae03bd19ca880b108afabac8a38f6535459ff9574b75c2f4
 SHA512 (tkdesk-2.0.tar.gz) = 482f69b9181b69a0903eff9afeeceefda949d620d7986d796589221a0a201f720e33aae05a622f597eb1072def96ff178232e1f432bc45947d298e730f47155a
@@ -9,10 +9,15 @@ Size (tkdesk-2.0p1.patch) = 3147 bytes
 BLAKE2s (tkdesk-2.0p2.patch) = a95322ec58e4fb1f6de9e489136c0d6c3d09c906f6d4deb3b6648c49dabd90fe
 SHA512 (tkdesk-2.0p2.patch) = 29171f1f706da9b2ecaf78a760138cfc70ed58a9630ce5e24a23cba9a68735a693c640e5e9378ce3f80dd919431b432b9e8afd3d544a73797d31957532d83802
 Size (tkdesk-2.0p2.patch) = 138282 bytes
-SHA1 (patch-aa) = d244a1e004247081b049156457d66c1952668a13
+SHA1 (patch-aa) = 13e1f7ed8b564774949498d2356c29a0ca23bcd1
 SHA1 (patch-ab) = 50e591e0732abf19bec531ba1667cadc6c4b24cf
 SHA1 (patch-ac) = 286a2bb4177431f87b778ed943cd57961aeb48ab
 SHA1 (patch-ae) = c09cd944af50c2a31020a7478c1568e847b0cb02
-SHA1 (patch-aj) = 42f4f44c8b5aff02bb409198fe96d42f987a165c
+SHA1 (patch-aj) = 72f8fdd5bf216fce0db937bfbb862ec540a28b96
 SHA1 (patch-ak) = 441a1eefd5872786981b25aa07482a8d6d9515aa
-SHA1 (patch-al) = 70a7a20f9e983ef1b31675631c5a7dd26e03b026
+SHA1 (patch-al) = d4f621554ae76d3ad061fe8c244e10633de4f367
+SHA1 (patch-libdesk_dsk__ls.c) = 1b5824d83b8665bc7b98fbd59fd2736ae17180a1
+SHA1 (patch-libdesk_misc.c) = a7e3e2d4b001b7528900a3ec663acbe62f5bbaaa
+SHA1 (patch-libdesk_o__FileListbox.c) = 90a19887846f869896d2aae8f17119a342b28cda
+SHA1 (patch-libdesk_ot.c) = e261153bcb876a0a30a1e2fd2854339d2b406446
+SHA1 (patch-netscape-remote_netscape-remote.c) = 3f6cda21fce514f8fbb14f066be23a479fc7e84f

Index: pkgsrc/sysutils/tkdesk/patches/patch-aa
diff -u pkgsrc/sysutils/tkdesk/patches/patch-aa:1.3 pkgsrc/sysutils/tkdesk/patches/patch-aa:1.4
--- pkgsrc/sysutils/tkdesk/patches/patch-aa:1.3 Sat Oct 14 02:18:37 2006
+++ pkgsrc/sysutils/tkdesk/patches/patch-aa     Mon Jun  6 05:11:58 2022
@@ -1,7 +1,12 @@
-$NetBSD: patch-aa,v 1.3 2006/10/14 02:18:37 rillig Exp $
+$NetBSD: patch-aa,v 1.4 2022/06/06 05:11:58 dholland Exp $
 
---- configure.orig     2004-04-14 05:39:47.000000000 +0200
-+++ configure  2006-10-14 04:17:03.000000000 +0200
+- Remove bashisms.
+- Fix itcl library names.
+- Fix BLT library names.
+- Avoid print from test(1) because ITCL_MAJOR_VERSION is never actually set.
+
+--- configure.orig     2004-04-14 03:39:47.000000000 +0000
++++ configure
 @@ -1430,7 +1430,7 @@ TK_LIB_STATIC=${TKCONF_PATH}/libtk${TK_V
  # Check for the TkStep libraries (if needed)...
  #
@@ -29,9 +34,12 @@ $NetBSD: patch-aa,v 1.3 2006/10/14 02:18
        { echo "$as_me:$LINENO: WARNING: you may be attempting to use TkDesk 2.x with an unsupported version of Tk.  Good luck.  Hope it works out for you." >&5
  echo "$as_me: WARNING: you may be attempting to use TkDesk 2.x with an unsupported version of Tk.  Good luck.  Hope it works out for you." >&2;}
     else
-@@ -1505,7 +1505,7 @@ echo $ECHO_N "checking version of Itcl..
+@@ -1503,9 +1503,9 @@ echo "${ECHO_T}$ITCLCONF_PATH/$ITCLCONF_
+ echo $ECHO_N "checking version of Itcl... $ECHO_C" >&6
+    echo "$as_me:$LINENO: result: $ITCL_VERSION" >&5
  echo "${ECHO_T}$ITCL_VERSION" >&6
-    if test "$ITCL_MAJOR_VERSION" -ne 3; then
+-   if test "$ITCL_MAJOR_VERSION" -ne 3; then
++   if test "${ITCL_MAJOR_VERSION:-3}" -ne 3; then
        echo
 -      if test "$ENABLE_UNSUPPORTED" == "yes" ; then
 +      if test "$ENABLE_UNSUPPORTED" = "yes" ; then
@@ -52,17 +60,28 @@ $NetBSD: patch-aa,v 1.3 2006/10/14 02:18
    fi
  fi
  
-@@ -1570,11 +1570,9 @@ else
-    BLT_LIB_SPEC="-L$BLT_LIB_PATH -lBLT"
-    BLT_LIB_STATIC=$BLT_LIB_PATH/libBLT.a
+@@ -1567,17 +1567,17 @@ if test -z "$BLT_LIB_PATH" ; then
+    echo "$as_me:$LINENO: result: ./blt" >&5
+ echo "${ECHO_T}./blt" >&6
+ else
+-   BLT_LIB_SPEC="-L$BLT_LIB_PATH -lBLT"
+-   BLT_LIB_STATIC=$BLT_LIB_PATH/libBLT.a
++   BLT_LIB_SPEC="-L$BLT_LIB_PATH -lBLT24"
++   BLT_LIB_STATIC=$BLT_LIB_PATH/libBLT24.a
     NEED_BLT_LIB=
 -   if test   ! -f $BLT_LIB_PATH/libBLT.a \
 -          -a ! -f $BLT_LIB_PATH/libBLT.so
-+   if test   ! -f $BLT_LIB_PATH/libBLT.a
++   if test   ! -f $BLT_LIB_PATH/libBLT24.a \
++          -a ! -f $BLT_LIB_PATH/libBLT24.so
     then
 -      if test   ! -f $BLT_LIB_PATH/lib/libBLT.a \
 -           -a ! -f $BLT_LIB_PATH/lib/libBLT.so
-+      if test   ! -f $BLT_LIB_PATH/lib/libBLT.a
++      if test   ! -f $BLT_LIB_PATH/lib/libBLT24.a \
++           -a ! -f $BLT_LIB_PATH/lib/libBLT24.so
        then
         echo
-        { { echo "$as_me:$LINENO: error: could not find libBLT.a or libBLT.so in $BLT_LIB_PATH or in $BLT_LIB_PATH/lib." >&5
+-       { { echo "$as_me:$LINENO: error: could not find libBLT.a or libBLT.so in $BLT_LIB_PATH or in $BLT_LIB_PATH/lib." >&5
++       { { echo "$as_me:$LINENO: error: could not find libBLT24.a or libBLT24.so in $BLT_LIB_PATH or in $BLT_LIB_PATH/lib." >&5
+ echo "$as_me: error: could not find libBLT.a or libBLT.so in $BLT_LIB_PATH or in $BLT_LIB_PATH/lib." >&2;}
+    { (exit 1); exit 1; }; }
+       else

Index: pkgsrc/sysutils/tkdesk/patches/patch-aj
diff -u pkgsrc/sysutils/tkdesk/patches/patch-aj:1.4 pkgsrc/sysutils/tkdesk/patches/patch-aj:1.5
--- pkgsrc/sysutils/tkdesk/patches/patch-aj:1.4 Sat Feb 22 07:53:47 2014
+++ pkgsrc/sysutils/tkdesk/patches/patch-aj     Mon Jun  6 05:11:58 2022
@@ -1,6 +1,9 @@
-$NetBSD: patch-aj,v 1.4 2014/02/22 07:53:47 obache Exp $
+$NetBSD: patch-aj,v 1.5 2022/06/06 05:11:58 dholland Exp $
 
---- libdesk/tixImgXpm.c.orig   2014-02-22 04:59:11.000000000 +0000
+- remove panic declaration (XXX: why?)
+- update for newer tcl
+
+--- libdesk/tixImgXpm.c.orig   2022-06-06 01:40:39.166611462 +0000
 +++ libdesk/tixImgXpm.c
 @@ -58,8 +58,6 @@
  #include "tkPort.h"*/
@@ -63,3 +66,16 @@ $NetBSD: patch-aj,v 1.4 2014/02/22 07:53
      *clientDataPtr = (ClientData) masterPtr;
      return TCL_OK;
  }
+@@ -1152,9 +1158,11 @@ ImgXpmCmd(clientData, interp, argc, argv
+     size_t length;
+ 
+     if (argc < 2) {
+-      sprintf(interp->result,
++      char buf[128];
++      snprintf(buf, sizeof(buf),
+           "wrong # args: should be \"%.50s option ?arg arg ...?\"",
+           argv[0]);
++      Tcl_SetResult(interp, buf, TCL_VOLATILE);
+       return TCL_ERROR;
+     }
+     c = argv[1][0];

Index: pkgsrc/sysutils/tkdesk/patches/patch-al
diff -u pkgsrc/sysutils/tkdesk/patches/patch-al:1.1 pkgsrc/sysutils/tkdesk/patches/patch-al:1.2
--- pkgsrc/sysutils/tkdesk/patches/patch-al:1.1 Sat Oct 14 02:18:37 2006
+++ pkgsrc/sysutils/tkdesk/patches/patch-al     Mon Jun  6 05:11:58 2022
@@ -1,7 +1,14 @@
-$NetBSD: patch-al,v 1.1 2006/10/14 02:18:37 rillig Exp $
+$NetBSD: patch-al,v 1.2 2022/06/06 05:11:58 dholland Exp $
 
---- configure.in.orig  2004-04-14 05:39:12.000000000 +0200
-+++ configure.in       2006-10-14 04:16:47.000000000 +0200
+- Remove bashisms.
+- Fix BLT library names.
+- Avoid print from test(1) because ITCL_MAJOR_VERSION is never actually set.
+
+Caution: it appears that not all of the direct changes to configure in
+its own patch (patch-aa) are reflected here.
+
+--- configure.in.orig  2004-04-14 03:39:12.000000000 +0000
++++ configure.in
 @@ -107,7 +107,7 @@ TK_LIB_STATIC=${TKCONF_PATH}/libtk${TK_V
  # Check for the TkStep libraries (if needed)...
  #
@@ -29,12 +36,40 @@ $NetBSD: patch-al,v 1.1 2006/10/14 02:18
        AC_MSG_WARN([you may be attempting to use TkDesk 2.x with an unsupported version of Tk.  Good luck.  Hope it works out for you.])
     else
        AC_MSG_ERROR([TkDesk version 2.x requires Tk version 8 or higher.  Please upgrade your Tk or, if that is not possible, you might prefer to use TkDesk version 1.2 instead.])
-@@ -167,7 +167,7 @@ if test $success = 1 ; then
+@@ -165,9 +165,9 @@ if test $success = 1 ; then
+ 
+    AC_MSG_CHECKING(version of Itcl)
     AC_MSG_RESULT($ITCL_VERSION)
-    if test "$ITCL_MAJOR_VERSION" -ne 3; then
+-   if test "$ITCL_MAJOR_VERSION" -ne 3; then
++   if test "${ITCL_MAJOR_VERSION:-3}" -ne 3; then
        echo
 -      if test "$ENABLE_UNSUPPORTED" == "yes" ; then
 +      if test "$ENABLE_UNSUPPORTED" = "yes" ; then
         AC_MSG_WARN([you may be attempting to use TkDesk 2.x with an unsupported version of Itcl.  Good luck.  Hope it works out for you.])
        else
         AC_MSG_ERROR([found Itcl, but it appears to be the wrong version.  TkDesk 2.x requires itcl 3.x to be installed.  Please get it from: http://www.incrtcl.sourceforge.net.])
+@@ -222,17 +222,17 @@ if test -z "$BLT_LIB_PATH" ; then
+    NEED_BLT_LIB=lib_blt
+    AC_MSG_RESULT(./blt)
+ else
+-   BLT_LIB_SPEC="-L$BLT_LIB_PATH -lBLT"
+-   BLT_LIB_STATIC=$BLT_LIB_PATH/libBLT.a
++   BLT_LIB_SPEC="-L$BLT_LIB_PATH -lBLT24"
++   BLT_LIB_STATIC=$BLT_LIB_PATH/libBLT24.a
+    NEED_BLT_LIB=
+-   if test   ! -f $BLT_LIB_PATH/libBLT.a \
+-          -a ! -f $BLT_LIB_PATH/libBLT.so
++   if test   ! -f $BLT_LIB_PATH/libBLT24.a \
++          -a ! -f $BLT_LIB_PATH/libBLT24.so
+    then
+-      if test   ! -f $BLT_LIB_PATH/lib/libBLT.a \
+-           -a ! -f $BLT_LIB_PATH/lib/libBLT.so
++      if test   ! -f $BLT_LIB_PATH/lib/libBLT24.a \
++           -a ! -f $BLT_LIB_PATH/lib/libBLT24.so
+       then
+        echo
+-       AC_MSG_ERROR([could not find libBLT.a or libBLT.so in $BLT_LIB_PATH or in $BLT_LIB_PATH/lib.])
++       AC_MSG_ERROR([could not find libBLT24.a or libBLT24.so in $BLT_LIB_PATH or in $BLT_LIB_PATH/lib.])
+       else
+        BLT_LIB_PATH=$BLT_LIB_PATH/lib
+       fi

Added files:

Index: pkgsrc/sysutils/tkdesk/patches/patch-libdesk_dsk__ls.c
diff -u /dev/null pkgsrc/sysutils/tkdesk/patches/patch-libdesk_dsk__ls.c:1.1
--- /dev/null   Mon Jun  6 05:11:59 2022
+++ pkgsrc/sysutils/tkdesk/patches/patch-libdesk_dsk__ls.c      Mon Jun  6 05:11:58 2022
@@ -0,0 +1,145 @@
+$NetBSD: patch-libdesk_dsk__ls.c,v 1.1 2022/06/06 05:11:58 dholland Exp $
+
+Update for Tcl 8.6 (?)
+Don't run off the end of strings.
+
+--- libdesk/dsk_ls.c~  2004-04-14 02:20:01.000000000 +0000
++++ libdesk/dsk_ls.c
+@@ -226,7 +226,7 @@ char *path;
+ #endif
+     
+     strncpy (par_path, path, MAXPATHLEN);
+-    par_path[MAXPATHLEN] = (char) NULL;
++    par_path[MAXPATHLEN - 1] = 0;
+     if (process_cmdline (argc, argv) != TCL_OK)
+       return (TCL_ERROR);
+ 
+@@ -374,8 +374,8 @@ FILE_ENTRY *fe;
+ 
+     if (S_ISLNK(fe->sb.st_mode)) {
+       strcpy (linkname, " -> ");
+-      len = readlink (fe->path, linkname + 4, MAXPATHLEN - 4);
+-      *(linkname + 4 + len) = (char) NULL;
++      len = readlink (fe->path, linkname + 4, MAXPATHLEN - 5);
++      *(linkname + 4 + len) = 0;
+       return (linkname);
+     } else {
+       return (strcpy (linkname, ""));
+@@ -1223,7 +1223,8 @@ char *path;
+     fprintf (stderr, "Opening %s ...\n", path);
+ #endif
+     if ((dp = opendir (path)) == NULL) {
+-      sprintf (dsk_interp->result, "no such file or dir: %s", path);
++      snprintf(buffer, MAXPATHLEN, "no such file or dir: %s", path);
++      Tcl_SetResult(dsk_interp, buffer, TCL_VOLATILE);
+       return (TCL_ERROR);
+     }
+ 
+@@ -1240,18 +1241,15 @@ char *path;
+           if (   (dir->d_name[1] == '\0')
+               || (dir->d_name[1] == '.' && dir->d_name[2] == '\0')) {
+               if (!par_no_points) {
+-                  strcpy (buffer, path);
+-                  strcat (buffer, dir->d_name);
++                  snprintf(buffer, MAXPATHLEN, "%s%s", path, dir->d_name);
+                   new_file_entry (buffer);
+               }
+           } else if (par_show_all) {
+-              strcpy (buffer, path);
+-              strcat (buffer, dir->d_name);
++              snprintf(buffer, MAXPATHLEN, "%s%s", path, dir->d_name);
+               new_file_entry (buffer);
+           }
+       } else {
+-          strcpy (buffer, path);
+-            strcat (buffer, dir->d_name);
++          snprintf(buffer, MAXPATHLEN, "%s%s", path, dir->d_name);
+           if (!par_only_directories) {
+               new_file_entry (buffer);
+           } else {
+@@ -1280,16 +1278,19 @@ int read_file_lists ()
+ {
+     struct stat sb;
+     char bc, *slash;
++    char buffer[MAXPATHLEN];
+ 
+     if (par_path[strlen (par_path) - 1] == '/' && !par_one_file) {
+       /* par_path is the name of a directory */
+       if (stat (par_path, &sb) < 0) {
+-          sprintf (dsk_interp->result, "no such file or dir: %s", par_path);
++          snprintf(buffer, MAXPATHLEN, "no such file or dir: %s", par_path);
++          Tcl_SetResult(dsk_interp, buffer, TCL_VOLATILE);
+           return (TCL_ERROR);
+       }
+     } else {
+       if (stat (par_path, &sb) < 0) {
+-          sprintf (dsk_interp->result, "no such file or dir: %s", par_path);
++          snprintf(buffer, MAXPATHLEN, "no such file or dir: %s", par_path);
++          Tcl_SetResult(dsk_interp, buffer, TCL_VOLATILE);
+           return (TCL_ERROR);
+       }
+       if (!S_ISDIR(sb.st_mode) || par_one_file) {
+@@ -1375,7 +1376,7 @@ char *argv[];
+               break;
+           case 'M':
+               if (argc == 2) {
+-                  strcpy (dsk_interp->result, USAGE);
++                  Tcl_SetResult(dsk_interp, USAGE, TCL_STATIC);
+                   return (TCL_ERROR);
+               }
+               i++; argc--;
+@@ -1398,7 +1399,7 @@ char *argv[];
+               break;
+           case 's':
+               if (argc == 2) {
+-                  strcpy (dsk_interp->result, USAGE);
++                  Tcl_SetResult(dsk_interp, USAGE, TCL_STATIC);
+                   return (TCL_ERROR);
+               }
+               i++; argc--;
+@@ -1415,9 +1416,11 @@ char *argv[];
+               else if (!strcmp ("not", argv[i]))
+                   par_sort_type = BY_NTH;
+               else {
+-                  sprintf (dsk_interp->result,
++                  char buffer[1024];
++                  snprintf(buffer, sizeof(buffer),
+                            "Don't know how to sort by %s.\n%s",
+                            argv[i], USAGE);
++                  Tcl_SetResult(dsk_interp, buffer, TCL_VOLATILE);
+                   return (TCL_ERROR);
+               }
+               break;
+@@ -1427,14 +1430,18 @@ char *argv[];
+           case 't':
+               par_append_char = 1;
+               break;
+-          default:
+-              sprintf (dsk_interp->result, "Dont understand: -%c\n%s",
+-                       argv[i][1], USAGE);
+-              return (TCL_ERROR);
++          default: {
++                  char buffer[1024];
++                  snprintf(buffer, sizeof(buffer),
++                           "Dont understand: -%c\n%s",
++                           argv[i][1], USAGE);
++                  Tcl_SetResult(dsk_interp, buffer, TCL_VOLATILE);
++                  return (TCL_ERROR);
++              }
+           }
+       } else {
+           if (*par_path) {
+-              strcpy (dsk_interp->result, USAGE);
++              Tcl_SetResult(dsk_interp, USAGE, TCL_STATIC);
+               return (TCL_ERROR);
+           }
+           strcpy (par_path, argv[i]);
+@@ -1444,7 +1451,7 @@ char *argv[];
+     }
+ 
+     if (!*par_path) {
+-      strcpy (dsk_interp->result, USAGE);
++      Tcl_SetResult(dsk_interp, USAGE, TCL_STATIC);
+       return (TCL_ERROR);
+     }
+ 
Index: pkgsrc/sysutils/tkdesk/patches/patch-libdesk_misc.c
diff -u /dev/null pkgsrc/sysutils/tkdesk/patches/patch-libdesk_misc.c:1.1
--- /dev/null   Mon Jun  6 05:11:59 2022
+++ pkgsrc/sysutils/tkdesk/patches/patch-libdesk_misc.c Mon Jun  6 05:11:58 2022
@@ -0,0 +1,100 @@
+$NetBSD: patch-libdesk_misc.c,v 1.1 2022/06/06 05:11:58 dholland Exp $
+
+Update interpreter result handling for Tcl 8.6 (?)
+Don't cast result of malloc.
+
+--- libdesk/misc.c.orig        2004-02-29 21:52:24.000000000 +0000
++++ libdesk/misc.c
+@@ -79,7 +79,7 @@ int dsk_striptc_Cmd (clientData, interp,
+     char instr[TCL_RESULT_SIZE], outstr[TCL_RESULT_SIZE];
+     
+     if (argc < 2 || argc > 3) {
+-      sprintf (interp->result, "usage: dsk_striptc ?-keep? string");
++      Tcl_SetResult(interp, "usage: dsk_striptc ?-keep? string", TCL_STATIC);
+       return (TCL_ERROR);
+     }
+     if (argc == 3) {
+@@ -87,7 +87,8 @@ int dsk_striptc_Cmd (clientData, interp,
+             keep = 1;
+             strcpy(instr, argv[2]);
+         } else {
+-            sprintf (interp->result, "usage: dsk_striptc ?-keep? string");
++            Tcl_SetResult(interp, "usage: dsk_striptc ?-keep? string",
++                        TCL_STATIC);
+             return (TCL_ERROR);
+         }
+     } else {
+@@ -95,7 +96,7 @@ int dsk_striptc_Cmd (clientData, interp,
+     }
+ 
+     if (instr[0] == 0) {
+-      *interp->result = 0;
++      Tcl_SetResult(interp, "", TCL_STATIC);
+       return (TCL_OK);
+     }
+ 
+@@ -125,7 +126,7 @@ int dsk_striptc_Cmd (clientData, interp,
+       }
+     }
+ 
+-    strcpy (interp->result, outstr);
++    Tcl_SetResult(interp, outstr, TCL_VOLATILE);
+     return (TCL_OK);
+ } /* dsk_striptc_Cmd */
+ 
+@@ -144,12 +145,12 @@ int dsk_esc_Cmd (clientData, interp, arg
+     char *buf;
+ 
+     if (argc != 3) {
+-      sprintf (interp->result, "usage: dsk_esc string chars");
++      Tcl_SetResult(interp, "usage: dsk_esc string chars", TCL_STATIC);
+       return (TCL_ERROR);
+     }
+ 
+     /* assume every char needs to be backslashed, for safety reasons */
+-    buf = (char *) malloc (strlen (argv[1]) * 2);
++    buf = malloc (strlen (argv[1]) * 2);
+     if (buf == NULL) {
+       fprintf (stderr, "out of memory in dsk_esc_Cmd\n");
+       exit (1);
+@@ -176,12 +177,12 @@ int dsk_unesc_Cmd (clientData, interp, a
+     char *buf;
+ 
+     if (argc != 2) {
+-      strcpy (interp->result, "usage: dsk_unesc string");
++      Tcl_SetResult(interp, "usage: dsk_unesc string", TCL_STATIC);
+       return (TCL_ERROR);
+     }
+ 
+     /* assume every char needs to be backslashed, for safety reasons */
+-    buf = (char *) malloc (strlen (argv[1]) * 2);
++    buf = malloc (strlen (argv[1]) * 2);
+     if (buf == NULL) {
+       fprintf (stderr, "out of memory in dsk_esc_Cmd\n");
+       exit (1);
+@@ -259,7 +260,7 @@ int dsk_statfs_Cmd (clientData, interp, 
+     char buf[64];
+     
+     if (argc != 2) {
+-      strcpy (interp->result, "usage: dskC_statfs path?/file?");
++      Tcl_SetResult(interp, "usage: dskC_statfs path?/file?", TCL_STATIC);
+       return TCL_ERROR;
+     }
+ 
+@@ -295,13 +296,14 @@ int dsk_statfs_Cmd (clientData, interp, 
+       return TCL_OK;
+       
+     } else {
+-      sprintf (interp->result, "Error %d", errno);
++      snprintf(buf, sizeof(buf), "Error %d", errno);
++      Tcl_SetResult(interp, buf, TCL_VOLATILE);
+       return TCL_ERROR;
+     }
+     
+ #else
+     
+-    strcpy (interp->result, "");
++    Tcl_SetResult(interp, "", TCL_STATIC);
+     return TCL_OK;
+     
+ #endif    
Index: pkgsrc/sysutils/tkdesk/patches/patch-libdesk_o__FileListbox.c
diff -u /dev/null pkgsrc/sysutils/tkdesk/patches/patch-libdesk_o__FileListbox.c:1.1
--- /dev/null   Mon Jun  6 05:11:59 2022
+++ pkgsrc/sysutils/tkdesk/patches/patch-libdesk_o__FileListbox.c       Mon Jun  6 05:11:58 2022
@@ -0,0 +1,79 @@
+$NetBSD: patch-libdesk_o__FileListbox.c,v 1.1 2022/06/06 05:11:58 dholland Exp $
+
+Update interpreter result handling for Tcl 8.6 (?)
+
+Also, memory allocated from inside tcl needs to be freed with Tcl_Free.
+
+--- libdesk/o_FileListbox.c.orig       2004-02-29 21:52:24.000000000 +0000
++++ libdesk/o_FileListbox.c
+@@ -69,7 +69,7 @@ int dsk_init_ftags_Cmd (clientData, inte
+ 
+     /* get and split the taglist */
+     if (targv != NULL)
+-      free ((char *)targv);
++      Tcl_Free ((char *)targv);
+     if (argc > 1) {
+       if (Tcl_SplitList (interp, argv[1], &targc, &targv) == TCL_ERROR)
+           return TCL_ERROR;
+@@ -81,7 +81,7 @@ int dsk_init_ftags_Cmd (clientData, inte
+ 
+     /* get and split tag masks */
+     if (pargv != NULL)
+-      free ((char *)pargv);
++      Tcl_Free ((char *)pargv);
+     if (argc > 2) {
+       if (Tcl_SplitList (interp, argv[2], &pargc, &pargv) == TCL_ERROR)
+           return TCL_ERROR;
+@@ -93,7 +93,7 @@ int dsk_init_ftags_Cmd (clientData, inte
+     
+     /* get and split ignore masks */
+     if (iargv != NULL)
+-      free ((char *)iargv);
++      Tcl_Free ((char *)iargv);
+     if (argc > 3) {
+       if (Tcl_SplitList (interp, argv[3], &iargc, &iargv) == TCL_ERROR)
+           return TCL_ERROR;
+@@ -139,7 +139,7 @@ int dsk_ls_and_tag_Cmd (clientData, inte
+ #endif
+ 
+     if (argc != 2) {
+-      strcpy (interp->result, "usage: dskC_ls_and_tag path");
++      Tcl_SetResult(interp, "usage: dskC_ls_and_tag path", TCL_STATIC);
+       return TCL_ERROR;
+     }
+ 
+@@ -170,7 +170,7 @@ int dsk_ls_and_tag_Cmd (clientData, inte
+     if (Tcl_SplitList (interp, lscmd, &lsargc, &lsargv) == TCL_ERROR)
+       return TCL_ERROR;
+     dsk_ls_init_and_parse_options (lsargc, lsargv, argv[1]);
+-    free (lsargv);
++    Tcl_Free (lsargv);
+     
+     /* now read and sort the file list */
+     fargc = dsk_ls_read_and_sort (iargc, (showall ? NULL : iargv),
+@@ -301,14 +301,14 @@ int dsk_ls_and_tag_Cmd (clientData, inte
+     /* free memory allocated by dsk_ls */
+     dsk_ls_cleanup();
+     if (!mask_matches_all)
+-      free (maskv);
++      Tcl_Free (maskv);
+ 
+     /*
+      * And now the tagging:
+      */
+     if (mtags) {
+       ot_invoke ("array names mt");
+-      strcpy (buf, interp->result);
++      strcpy (buf, Tcl_GetStringResult(interp));
+       if (Tcl_SplitList (interp, buf, &mtargc, &mtargv) == TCL_ERROR)
+         return TCL_ERROR;
+ 
+@@ -343,7 +343,7 @@ int dsk_ls_and_tag_Cmd (clientData, inte
+       }
+       Tcl_DStringFree (&dbigcmd);
+ 
+-      free (mtargv);
++      Tcl_Free (mtargv);
+     }
+     
+     if (add_images && notmatch_set) {
Index: pkgsrc/sysutils/tkdesk/patches/patch-libdesk_ot.c
diff -u /dev/null pkgsrc/sysutils/tkdesk/patches/patch-libdesk_ot.c:1.1
--- /dev/null   Mon Jun  6 05:11:59 2022
+++ pkgsrc/sysutils/tkdesk/patches/patch-libdesk_ot.c   Mon Jun  6 05:11:58 2022
@@ -0,0 +1,76 @@
+$NetBSD: patch-libdesk_ot.c,v 1.1 2022/06/06 05:11:58 dholland Exp $
+
+Update interpreter result handling for Tcl 8.6 (?)
+
+Also, memory allocated from inside tcl needs to be freed with Tcl_Free.
+
+--- libdesk/ot.c.orig  2004-04-14 02:34:37.000000000 +0000
++++ libdesk/ot.c
+@@ -150,7 +150,8 @@ char *argv[];
+     char **largv;
+ 
+     if (argc < 3) {
+-      interp->result = "usage: ot_maplist list var ?var ...?";
++      Tcl_SetResult(interp, "usage: ot_maplist list var ?var ...?",
++                    TCL_STATIC);
+       return TCL_ERROR;
+     }
+ 
+@@ -160,7 +161,7 @@ char *argv[];
+ 
+     for (i = 0; i < largc; i++) {
+       if (!Tcl_SetVar (interp, argv[i + 2], largv[i], TCL_LEAVE_ERR_MSG)) {
+-          free (largv);
++          Tcl_Free (largv);
+           return TCL_ERROR;
+       }
+ 
+@@ -169,7 +170,7 @@ char *argv[];
+           for (j = i + 1; j < largc; j++) {
+               if (!Tcl_SetVar (interp, argv[i + 2], largv[j],
+                      TCL_LEAVE_ERR_MSG|TCL_LIST_ELEMENT|TCL_APPEND_VALUE)) {
+-                  free (largv);
++                  Tcl_Free (largv);
+                   return TCL_ERROR;
+               }
+           }
+@@ -177,7 +178,7 @@ char *argv[];
+       }
+     }
+ 
+-    free (largv);
++    Tcl_Free (largv);
+     return TCL_OK;
+ } /* ot_maplist_Cmd */
+ 
+@@ -204,7 +205,9 @@ char *argv[];
+     int x, y;
+     
+     if (argc != 2 && argc != 3) {
+-      interp->result = "usage: ot_warp_pointer window / ot_warp_pointer x y";
++      Tcl_SetResult(interp,
++                    "usage: ot_warp_pointer window / ot_warp_pointer x y",
++                    TCL_STATIC);
+       return TCL_ERROR;
+     }
+ 
+@@ -262,14 +265,16 @@ char *cmd;
+     }
+ 
+     if (Tcl_GetCommandInfo (interp, argv[0], &cmdInfo) == 0) {
+-        sprintf (interp->result, "invalid command name \"%s\"", argv[0]);
+-      free (argv);
++      char buf[1024];
++      snprintf(buf, sizeof(buf), "invalid command name \"%s\"", argv[0]);
++      Tcl_SetResult(interp, buf, TCL_VOLATILE);
++      Tcl_Free (argv);
+         return TCL_ERROR;
+     }
+ 
+     Tcl_ResetResult (interp);
+     retval = (*cmdInfo.proc) (cmdInfo.clientData, interp, argc, argv);
+-    free (argv);
++    Tcl_Free (argv);
+     return retval;
+ } /* Ot_TclInvoke */
+ 
Index: pkgsrc/sysutils/tkdesk/patches/patch-netscape-remote_netscape-remote.c
diff -u /dev/null pkgsrc/sysutils/tkdesk/patches/patch-netscape-remote_netscape-remote.c:1.1
--- /dev/null   Mon Jun  6 05:11:59 2022
+++ pkgsrc/sysutils/tkdesk/patches/patch-netscape-remote_netscape-remote.c      Mon Jun  6 05:11:58 2022
@@ -0,0 +1,14 @@
+$NetBSD: patch-netscape-remote_netscape-remote.c,v 1.1 2022/06/06 05:11:58 dholland Exp $
+
+Use standard headers.
+
+--- netscape-remote/netscape_remote.c~ 2004-02-29 21:52:24.000000000 +0000
++++ netscape-remote/netscape_remote.c
+@@ -31,6 +31,7 @@ static char rcsid[]=
+ #include "config.h"
+ #include <sys/types.h>
+ #include <unistd.h>
++#include <string.h>
+ #ifdef HAVE_TCL8_0_H
+ #include <tcl8.0.h>
+ #include <tk8.0.h>



Home | Main Index | Thread Index | Old Index