diff -Nru autocutsel-0.10.0/autocutsel.c autocutsel-0.10.1/autocutsel.c --- autocutsel-0.10.0/autocutsel.c 2014-10-07 12:27:37.000000000 +0000 +++ autocutsel-0.10.1/autocutsel.c 2021-03-03 11:24:45.000000000 +0000 @@ -1,16 +1,16 @@ /* * autocutsel by Michael Witrant * Synchronizes the cutbuffer and the selection - * Copyright (c) 2001-2006 Michael Witrant. - * + * Copyright (c) 2001-2021 Michael Witrant. + * * Most code taken from: * * clear-cut-buffers.c by "E. Jay Berkenbilt" * in this messages: * http://boudicca.tux.org/mhonarc/ma-linux/2001-Feb/msg00824.html - * + * * * xcutsel.c by Ralph Swick, DEC/Project Athena * from the XFree86 project: http://www.xfree86.org/ - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -27,7 +27,7 @@ * * This program is distributed under the terms * of the GNU General Public License (read the COPYING file) - * + * */ #include "common.h" @@ -55,7 +55,7 @@ { fprintf (stderr, "usage: %s [-selection ] [-cutbuffer ]" - " [-pause ] [-debug] [-verbose] [-fork] [-buttonup]\n", + " [-pause ] [-debug] [-verbose] [-fork] [-buttonup]\n", call); exit (1); } @@ -91,7 +91,7 @@ close (fd); } -static RETSIGTYPE Terminate(int caught) +static void Terminate(int caught) { exit (0); } @@ -156,21 +156,21 @@ unsigned long *received_length, int *format) { int length = *received_length; - - if (*type == 0 || - *type == XT_CONVERT_FAIL || - length == 0 || + + if (*type == 0 || + *type == XT_CONVERT_FAIL || + length == 0 || ValueDiffers(value, length)) { if (options.debug) printf("Selection is out of date. Owning it\n"); - + if (options.verbose) { printf("cut -> sel: "); PrintValue(options.value, options.length); printf("\n"); } - + if (XtOwnSelection(box, options.selection, 0, //XtLastTimestampProcessed(dpy), ConvertSelection, LoseSelection, NULL) == True) { @@ -189,16 +189,16 @@ { char *value; int length; - + value = XFetchBuffer(dpy, &length, buffer); - + if (length > 0 && ValueDiffers(value, length)) { if (options.debug) { printf("Buffer changed: "); PrintValue(value, length); printf("\n"); } - + ChangeValue(value, length); XtGetSelectionValue(box, selection, XInternAtom(dpy, "UTF8_STRING", False), OwnSelectionIfDiffers, NULL, @@ -214,7 +214,7 @@ unsigned long *received_length, int *format) { int length = *received_length; - + if (*type != 0 && *type != XT_CONVERT_FAIL) { if (length > 0 && ValueDiffers(value, length)) { if (options.debug) { @@ -222,7 +222,7 @@ PrintValue((char*)value, length); printf("\n"); } - + ChangeValue((char*)value, length); if (options.verbose) { printf("sel -> cut: "); @@ -231,18 +231,18 @@ } if (options.debug) printf("Updating buffer\n"); - + XStoreBuffer(XtDisplay(w), (char*)options.value, (int)(options.length), buffer ); - + XtFree(value); return; } } XtFree(value); - + // Unless a new selection value is found, check the buffer value CheckBuffer(); } @@ -269,7 +269,7 @@ SelectionReceived, NULL, CurrentTime); } - + XtAppAddTimeOut(context, options.pause, timeout, 0); } @@ -293,20 +293,20 @@ options.debug = 1; else options.debug = 0; - + if (strcmp(options.verbose_option, "on") == 0) options.verbose = 1; else options.verbose = 0; - + if (options.debug || options.verbose) printf("autocutsel v%s\n", VERSION); - + if (strcmp(options.buttonup_option, "on") == 0) options.buttonup = 1; else options.buttonup = 0; - + if (strcmp(options.fork_option, "on") == 0) { options.fork = 1; options.verbose = 0; @@ -342,14 +342,14 @@ options.length = 0; options.own_selection = 0; - + box = XtCreateManagedWidget("box", boxWidgetClass, top, NULL, 0); dpy = XtDisplay(top); selection = XInternAtom(dpy, options.selection_name, 0); options.selection = selection; buffer = 0; - + options.value = XFetchBuffer(dpy, &options.length, buffer); XtAppAddTimeOut(context, options.pause, timeout, 0); @@ -385,6 +385,6 @@ XChangeProperty(dpy, XtWindow(top), atoms[_NET_WM_PID], atoms[CARDINAL], 32, PropModeReplace, (const unsigned char*)&pid, 1); XtAppMainLoop(context); - + return 0; } diff -Nru autocutsel-0.10.0/ChangeLog autocutsel-0.10.1/ChangeLog --- autocutsel-0.10.0/ChangeLog 2014-10-07 12:27:37.000000000 +0000 +++ autocutsel-0.10.1/ChangeLog 2021-03-03 11:24:45.000000000 +0000 @@ -1,3 +1,7 @@ +v0.10.1: 2021-03-03 + - fixed allocation error (Jeremie Courreges-Anglas) + - updated configure scripts + v0.10.0: 2014-05-04 - set WM_NAME, _NET_WM_NAME, and _NET_WM_PID (Michael Stapelberg) - support for UTF-8 strings @@ -38,13 +42,13 @@ - added a cutsel tools to change/retreive the cutbuffer or the selection - fixed minor bugs - + v0.6.1: 2002-06-02 - uses the length of values instead of '\0' at the end v0.6: 2002-05-27 - fixed a memory leak - + v0.5: 2002-05-26 - fixed a bug the prevented selection to be owned when the cutbuffer was modified @@ -58,7 +62,7 @@ - improved debug messages - memory leak fixed? - minor bugfixes - + v0.3: - applied a patch from Mark Warburton to ignore the cutbuffer value if it's empty diff -Nru autocutsel-0.10.0/common.c autocutsel-0.10.1/common.c --- autocutsel-0.10.0/common.c 2014-10-07 12:27:37.000000000 +0000 +++ autocutsel-0.10.1/common.c 2021-03-03 11:24:45.000000000 +0000 @@ -1,8 +1,8 @@ /* * autocutsel by Michael Witrant * Manipulates the cutbuffer and the selection - * Copyright (c) 2001-2006 Michael Witrant. - * + * Copyright (c) 2001-2021 Michael Witrant. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -19,9 +19,9 @@ * * This program is distributed under the terms * of the GNU General Public License (read the COPYING file) - * + * */ - + #include "common.h" Widget box; @@ -35,7 +35,7 @@ { unsigned char c; int len = 0; - + putc('"', stdout); for (; length > 0; length--, value++) { c = (unsigned char)*value; @@ -63,7 +63,7 @@ } putc('"', stdout); } - + // called when someone requests the selection value @@ -75,23 +75,23 @@ XSelectionRequestEvent* req = XtGetSelectionRequest(w, *selection, (XtRequestId)NULL); Atom utf8_string = XInternAtom(d, "UTF8_STRING", False); - + if (options.debug) { printf("Window 0x%lx requested %s of selection %s.\n", req->requestor, XGetAtomName(d, *target), XGetAtomName(d, *selection)); } - + if (*target == XA_TARGETS(d)) { Atom *targetP, *atoms; XPointer std_targets; unsigned long std_length; int i; - + XmuConvertStandardSelection(w, req->time, selection, target, type, &std_targets, &std_length, format); - *value = XtMalloc(sizeof(Atom)*(std_length + 4)); + *value = XtMalloc(sizeof(Atom)*(std_length + 5)); targetP = *(Atom**)value; atoms = targetP; *length = std_length + 5; @@ -104,7 +104,7 @@ XtFree((char*)std_targets); *type = XA_ATOM; *format = 32; - + if (options.debug) { printf("Targets are: "); for (i=0; i<*length; i++) @@ -114,7 +114,7 @@ return True; } - + if (*target == utf8_string || *target == XA_STRING || *target == XA_TEXT(d)) { *type = *target; *value = XtMalloc((Cardinal) options.length); @@ -127,10 +127,10 @@ PrintValue((char*)*value, *length); printf("\n"); } - + return True; } - + if (*target == XA_LIST_LENGTH(d)) { CARD32 *temp = (CARD32 *) XtMalloc(sizeof(CARD32)); *temp = 1L; @@ -144,7 +144,7 @@ return True; } - + if (*target == XA_LENGTH(d)) { CARD32 *temp = (CARD32 *) XtMalloc(sizeof(CARD32)); *temp = options.length; @@ -158,13 +158,13 @@ return True; } - + if (XmuConvertStandardSelection(w, req->time, selection, target, type, (XPointer *)value, length, format)) { printf("Returning conversion of standard selection\n"); return True; } - + /* else */ if (options.debug) printf("Target not supported\n"); diff -Nru autocutsel-0.10.0/common.h autocutsel-0.10.1/common.h --- autocutsel-0.10.0/common.h 2014-10-07 12:27:37.000000000 +0000 +++ autocutsel-0.10.1/common.h 2021-03-03 11:24:45.000000000 +0000 @@ -1,8 +1,8 @@ /* * autocutsel by Michael Witrant * Manipulates the cutbuffer and the selection - * Copyright (c) 2001-2006 Michael Witrant. - * + * Copyright (c) 2001-2021 Michael Witrant. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -19,7 +19,7 @@ * * This program is distributed under the terms * of the GNU General Public License (read the COPYING file) - * + * */ #include "config.h" @@ -54,8 +54,8 @@ String buttonup_option; String kill; int pause; - int debug; - int verbose; + int debug; + int verbose; int fork; Atom selection; char* value; diff -Nru autocutsel-0.10.0/configure.ac autocutsel-0.10.1/configure.ac --- autocutsel-0.10.0/configure.ac 2014-10-07 12:27:37.000000000 +0000 +++ autocutsel-0.10.1/configure.ac 2021-03-03 11:24:45.000000000 +0000 @@ -1,15 +1,15 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([autocutsel], [0.10.0]) +AC_INIT([autocutsel],[0.10.1]) AC_CONFIG_SRCDIR([autocutsel.c]) AM_INIT_AUTOMAKE AC_CONFIG_MACRO_DIRS([m4]) -AM_CONFIG_HEADER(config.h) +AC_CONFIG_HEADERS(config.h) dnl Checks for programs. AC_PROG_CC -AC_PROG_LIBTOOL +LT_INIT AC_PATH_XTRA if test "$no_x" = "yes" then @@ -19,7 +19,7 @@ LIBS="$X_PRE_LIBS $X_LIBS $LIBS -lX11 $X_EXTRA_LIBS" -AC_CHECK_LIB(Xaw, main, +AC_CHECK_LIB(Xaw, main, LIBS="$LIBS -lXaw", AC_MSG_ERROR(Unable to find Xaw library), $LIBS) @@ -34,23 +34,17 @@ AC_MSG_ERROR(Unable to find Xmu library), $LIBS) -dnl Checks for libraries. - -dnl Checks for header files. - -dnl Checks for typedefs, structures, and compiler characteristics. -AC_TYPE_SIGNAL - dnl Checks for library functions. AC_FUNC_SETPGRP dnl Warnings AC_MSG_CHECKING([whether to enable -Wall]) -if test -n "$GCC"; then +if test -n "$GCC"; then AC_MSG_RESULT(adding -Wall to CFLAGS.) CFLAGS="$CFLAGS -Wall" else AC_MSG_RESULT(no) fi -AC_OUTPUT(Makefile) +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff -Nru autocutsel-0.10.0/cutsel.c autocutsel-0.10.1/cutsel.c --- autocutsel-0.10.0/cutsel.c 2014-10-07 12:27:37.000000000 +0000 +++ autocutsel-0.10.1/cutsel.c 2021-03-03 11:24:45.000000000 +0000 @@ -1,8 +1,8 @@ /* * autocutsel by Michael Witrant * Manipulates the cutbuffer and the selection - * Copyright (c) 2001-2006 Michael Witrant. - * + * Copyright (c) 2001-2021 Michael Witrant. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -19,7 +19,7 @@ * * This program is distributed under the terms * of the GNU General Public License (read the COPYING file) - * + * */ @@ -81,7 +81,7 @@ unsigned long *received_length, int *format) { Display* d = XtDisplay(w); - + if (*type == 0) printf("Nobody owns the selection\n"); else if (*type == XA_STRING) @@ -100,7 +100,7 @@ Display* d = XtDisplay(w); int i; Atom *atoms; - + if (*type == 0) printf("No target received\n"); else if (*type == XA_ATOM) { @@ -120,7 +120,7 @@ unsigned long *received_length, int *format) { Display* d = XtDisplay(w); - + if (*type == 0) printf("No length received\n"); else if (*type == XA_INTEGER) { @@ -191,7 +191,7 @@ options.debug = 1; else options.debug = 0; - + if (strcmp(options.verbose_option, "on") == 0) options.verbose = 1; else @@ -199,13 +199,13 @@ if (options.debug || options.verbose) printf("cutsel v%s\n", VERSION); - + options.value = NULL; options.length = 0; box = XtCreateManagedWidget("box", boxWidgetClass, top, NULL, 0); dpy = XtDisplay(top); - + selection = XInternAtom(dpy, options.selection_name, 0); options.selection = selection; buffer = 0; diff -Nru autocutsel-0.10.0/debian/changelog autocutsel-0.10.1/debian/changelog --- autocutsel-0.10.0/debian/changelog 2017-01-16 14:09:29.000000000 +0000 +++ autocutsel-0.10.1/debian/changelog 2021-08-29 00:00:24.000000000 +0000 @@ -1,3 +1,28 @@ +autocutsel (0.10.1-1) unstable; urgency=medium + + [ Debian Janitor ] + * Trim trailing whitespace. + * Use secure copyright file specification URI. + * Use secure URI in Homepage field. + * Bump debhelper from old 9 to 12. + * Set debhelper-compat version in Build-Depends. + * Set upstream metadata fields: Bug-Database, Bug-Submit, Repository, + Repository-Browse. + * Drop unnecessary dependency on dh-autoreconf. + + [ Axel Beckert ] + * Import new upstream release 0.10.1. + * Bump debhelper-compat to 13. + * Use common capitalization of "Vcs-*" headers. + * Set "Rules-Requires-Root: no". + * Bump debian/watch file version to 4. + * debian/copyright: + + Bump copyright years. + + Reduce redundant "Copyright: Copyright (C)" to just "Copyright:". + * Declare compliance with Debian Policy 4.6.0. (No changes needed.) + + -- Axel Beckert Sun, 29 Aug 2021 02:00:24 +0200 + autocutsel (0.10.0-2) unstable; urgency=medium * reformat debian/copyright to be compliant with DEP-5 @@ -73,4 +98,3 @@ * added debian/watch -- Elmar S. Heeb Thu, 3 Jan 2008 12:26:47 +0100 - diff -Nru autocutsel-0.10.0/debian/compat autocutsel-0.10.1/debian/compat --- autocutsel-0.10.0/debian/compat 2017-01-15 13:16:54.000000000 +0000 +++ autocutsel-0.10.1/debian/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -9 diff -Nru autocutsel-0.10.0/debian/control autocutsel-0.10.1/debian/control --- autocutsel-0.10.0/debian/control 2017-01-16 13:32:40.000000000 +0000 +++ autocutsel-0.10.1/debian/control 2021-08-28 17:58:01.000000000 +0000 @@ -3,14 +3,14 @@ Priority: optional Maintainer: Elmar S. Heeb Uploaders: Axel Beckert -Build-Depends: dh-autoreconf, - debhelper (>= 9), +Build-Depends: debhelper-compat (= 13), dpkg-dev (>= 1.16.1~), libxaw7-dev -Standards-Version: 3.9.8 -Homepage: http://www.nongnu.org/autocutsel/ -VCS-Git: https://github.com/elmar/autocutsel-debian.git -VCS-Browser: https://github.com/elmar/autocutsel-debian +Standards-Version: 4.6.0 +Homepage: https://www.nongnu.org/autocutsel/ +Vcs-Git: https://github.com/elmar/autocutsel-debian.git +Vcs-Browser: https://github.com/elmar/autocutsel-debian +Rules-Requires-Root: no Package: autocutsel Architecture: any diff -Nru autocutsel-0.10.0/debian/copyright autocutsel-0.10.1/debian/copyright --- autocutsel-0.10.0/debian/copyright 2017-01-16 13:28:58.000000000 +0000 +++ autocutsel-0.10.1/debian/copyright 2021-08-28 17:56:51.000000000 +0000 @@ -1,14 +1,15 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: autocutsel Upstream-Contact: Michael Witrant Source: http://www.nongnu.org/autocutsel/ Files: * -Copyright: Copyright (C) 2001-2006 Michael Witrant +Copyright: 2001-2021 Michael Witrant License: GPL-2+ Files: debian/* -Copyright: 2007-2012, Elmar S. Heeb +Copyright: 2007-2017, Elmar S. Heeb + 2021 Axel Beckert License: GPL-2+ License: GPL-2+ diff -Nru autocutsel-0.10.0/debian/rules autocutsel-0.10.1/debian/rules --- autocutsel-0.10.0/debian/rules 2017-01-16 14:04:25.000000000 +0000 +++ autocutsel-0.10.1/debian/rules 2021-08-28 17:40:51.000000000 +0000 @@ -6,4 +6,4 @@ export DEB_BUILD_MAINT_OPTIONS=hardening=+all %: - dh $@ --with=autoreconf + dh $@ diff -Nru autocutsel-0.10.0/debian/upstream/metadata autocutsel-0.10.1/debian/upstream/metadata --- autocutsel-0.10.0/debian/upstream/metadata 1970-01-01 00:00:00.000000000 +0000 +++ autocutsel-0.10.1/debian/upstream/metadata 2021-08-28 17:40:51.000000000 +0000 @@ -0,0 +1,4 @@ +Bug-Database: https://github.com/sigmike/autocutsel/issues +Bug-Submit: https://github.com/sigmike/autocutsel/issues/new +Repository: https://github.com/sigmike/autocutsel.git +Repository-Browse: https://github.com/sigmike/autocutsel diff -Nru autocutsel-0.10.0/debian/watch autocutsel-0.10.1/debian/watch --- autocutsel-0.10.0/debian/watch 2017-01-15 13:16:54.000000000 +0000 +++ autocutsel-0.10.1/debian/watch 2021-08-28 17:48:52.000000000 +0000 @@ -1,5 +1,5 @@ # format version number, currently 3; this line is compulsory! -version=3 +version=4 opts=uversionmangle=s/_/./g,filenamemangle=s/.+\/v?(\d[^\/]*)\.tar\.gz/autocutsel-$1\.tar\.gz/ \ https://github.com/sigmike/autocutsel/releases .*/v?(\d[^\/]*)\.tar\.gz diff -Nru autocutsel-0.10.0/README autocutsel-0.10.1/README --- autocutsel-0.10.0/README 2014-10-07 12:27:37.000000000 +0000 +++ autocutsel-0.10.1/README 2021-03-03 11:24:45.000000000 +0000 @@ -1,7 +1,7 @@ autocutsel http://www.nongnu.org/autocutsel/ https://github.com/sigmike/autocutsel -Copyright (c) 2001-2006 - Michael Witrant +Copyright (c) 2001-2021 - Michael Witrant X servers use two schemes to copy text between applications. The first one (old and deprecated) is the cutbuffer. It is a simple buffer in which any @@ -36,7 +36,7 @@ ./configure make -If you downloaded autocutsel from CVS, you first have to run ./autogen.sh to +If you downloaded autocutsel from git you first have to run ./bootstrap to build the configure script. If configure fails because it can't find X or Xaw libraries, you may have to @@ -65,7 +65,7 @@ Michael Witrant - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or diff -Nru autocutsel-0.10.0/test_autocutsel.rb autocutsel-0.10.1/test_autocutsel.rb --- autocutsel-0.10.0/test_autocutsel.rb 2013-11-21 13:57:58.000000000 +0000 +++ autocutsel-0.10.1/test_autocutsel.rb 2021-03-03 11:24:45.000000000 +0000 @@ -1,8 +1,8 @@ =begin * autocutsel by Michael Witrant * Manipulates the cutbuffer and the selection - * Copyright (c) 2001-2006 Michael Witrant. - * + * Copyright (c) 2001-2021 Michael Witrant. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -19,7 +19,7 @@ * * This program is distributed under the terms * of the GNU General Public License (read the COPYING file) - * + * =end require 'test/unit' @@ -32,15 +32,15 @@ result = nil if result == "Nobody owns the selection" result end - + def get_buffer %x(./cutsel cut).chomp end - + def set_buffer value system "./cutsel", "cut", value end - + def set_selection value, selection = nil command = ["./cutsel", "sel", value] command += ["-s", selection] if selection @@ -57,7 +57,7 @@ Process.waitpid pid end end - + def run_autocutsel options = {} command = ["./autocutsel", "-pause", "1"] command += ["-s", options[:selection]] if options[:selection] @@ -85,7 +85,7 @@ end end end - + def get_targets %x(./cutsel targets).split("\n")[1..-1] end @@ -95,14 +95,14 @@ set_buffer "cutbuffer value" assert_equal "cutbuffer value", get_buffer end - + def test_cutsel_owns_selection set_selection "selection value" do assert_equal "selection value", get_selection end assert_nil get_selection end - + def test_autocutsel_changes_buffer set_buffer "foo" run_autocutsel do @@ -114,13 +114,13 @@ assert_equal "bar", get_buffer assert_nil get_selection end - + def test_autocutsel_owns_selection run_autocutsel_and_make_it_own_selection "my value" do assert_equal "my value", get_selection end end - + def test_autocutsel_targets run_autocutsel_and_make_it_own_selection do targets = get_targets @@ -129,14 +129,14 @@ end end end - + def test_default_selection run_autocutsel_and_make_it_own_selection __method__.to_s do assert_equal __method__.to_s, get_selection("CLIPBOARD") assert_nil get_selection("my_selection") end end - + def test_primary_selection clipboard_value = get_selection("CLIPBOARD") run_autocutsel_and_make_it_own_selection __method__.to_s, "PRIMARY" do