]> cygwin.com Git - cygwin-apps/cygutils.git/commitdiff
Update to released 1.4.16-4 content
authorMark Geisert <mark@maxrnd.com>
Sat, 25 Sep 2021 05:37:55 +0000 (22:37 -0700)
committerMark Geisert <mark@maxrnd.com>
Sat, 25 Sep 2021 05:37:55 +0000 (22:37 -0700)
ChangeLog
Makefile.am
NEWS
cygutils.cygport
src/clip/getclip.c
src/cygdrop/cygdrop.cc

index c67ee007d6d148955b7dadc5c4ef08c0a088e7e9..65421528dd4aa5dbe18223dd1352ba392760edde 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2021-08-15  Mark Geisert  <mark@maxrnd.com>
+
+       * Makefile.am: Add -lkernel32 to src_clip_getclip_LDADD.  This somehow
+       didn't make it into the released -3 package.  Thank you Takashi Yano.
+       * Fix maintainer build environment issues that caused cygstart crash
+       on non-AVX user systems: Thank you Takashi Yano, Brian Inglis, Achim
+       Gratz and user Jay Abel for reporting the issue.
+       * src/cygdrop/cygdrop.cc: Fix crash with recent gcc and fix printf
+       format strings. Thank you Christian Franke.
+
+2021-07-05  Mark Geisert  <mark@maxrnd.com>
+
+       * src/clip/getclip.c: Add Unicode support.
+
 2017-07-03  Mark Geisert  <mark@maxrnd.com>
 
        Release 1.4.16
index 79eb2b1dec33494136928e845c2388d17dfab758..bcad1c6c7531206bb0f8790f1b47d7f165434466 100644 (file)
@@ -117,7 +117,7 @@ DISTCLEANFILES = \
 
 libuuid = `${CC} -print-file-name=w32api/libuuid.a`
 src_banner_banner_LDADD             = -lpopt -lkernel32 -lgdi32
-src_clip_getclip_LDADD              = -lpopt
+src_clip_getclip_LDADD              = -lpopt -lkernel32
 src_clip_putclip_LDADD              = -lpopt
 src_conv_conv_LDADD                 = -lpopt
 src_cygstart_cygstart_LDADD         = -lpopt
diff --git a/NEWS b/NEWS
index dbc98790a4b4bd48202d4bfd5746a51fe563dc41..99914d42339915af7dbd504a3c19bb63b1f5929e 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,7 @@
   * Minor formatting fixes to quash compiler warnings.
   * Execute bits removed from files not needing them.
   * Temporarily rename /usr/lib/libpopt.la while building package.
+  * Unicode support added to getclip.
 
 1.4.15
   New maintainer Mark Geisert <mark@maxrnd.com>.
index 6f603aa582cabf2cc2c74a19ea3b5883d1e8ad65..398e4335bf44c0fb9c2436ce3ddf8c1dd6643b81 100644 (file)
@@ -1,6 +1,6 @@
 NAME=cygutils
 VERSION=1.4.16
-RELEASE=3
+RELEASE=4
 
 SUMM="A collection of simple utilities"
 DESC="A collection of simple (single source file) utilities, including"
index 21eef59e013423378a65869d80971a20077f9347..e9300ea42476a4be5e34d3f79f23a8e5a4c087c5 100644 (file)
@@ -31,9 +31,7 @@
 #include <io.h>
 #include <wchar.h>
 #include <sys/cygwin.h>
-#include <w32api/ntstatus.h>
-/* This Windows 7+ function is not yet present in w32api/winternl.h */
-extern NTSYSAPI NTSTATUS RtlUnicodeToUTF8N(PCHAR, ULONG, PULONG, LPWSTR, ULONG);
+#include <w32api/stringapiset.h>
 
 #define DEBUGGING 0 // Set 1 to display debug output on stderr
 
@@ -424,19 +422,21 @@ getclip (FILE * out, flags_struct flags, FILE * f, char *name)
           LPWSTR lpwstr = (LPWSTR) GlobalLock (hglb);
           if (lpwstr)
             {
-              ULONG count;
-              ULONG srclen = wcslen (lpwstr) * sizeof (wchar_t); // byte count
-              ULONG dstlen = srclen + 32;
-              PCHAR dst = (PCHAR) malloc (dstlen);
-              NTSTATUS res = RtlUnicodeToUTF8N (dst, dstlen, &count,
-                                                lpwstr, srclen);
+              int srclen = wcslen (lpwstr); // wide-char count
+              int dstlen = srclen << 2; // byte count
+              LPSTR dst = (LPSTR) malloc (dstlen);
+              int res = WideCharToMultiByte (CP_UTF8, 0, lpwstr, srclen,
+                                             dst, dstlen, NULL, NULL);
+              if (res > 0)
+                fwrite (dst, sizeof (char), res, out);
+              else if (res == 0)
+                {
 #if DEBUGGING
-              /* look up hex error code displayed here in w32api/ntstatus.h */
-              fprintf (stderr, "RtlUnicodeToUTF8N returns 0x%X\n", res);
+                  DWORD err = GetLastError ();
+                  /* look up error code displayed here in w32api/winerror.h */
+                  fprintf (stderr, "WideCharToMultiByte returns %d\n", err);
 #endif
-              if (res == STATUS_SUCCESS || res == STATUS_SOME_NOT_MAPPED)
-                if (count > 0)
-                  fwrite (dst, sizeof (char), count, out);
+                }
               free (dst);
               GlobalUnlock (hglb);
             }
index 35bcc19f5fb9f69b9e4dbef5c66ee2c3e1ab90dc..0c036bb37347de1b5b852320cd7e2cf55027c706 100644 (file)
@@ -39,7 +39,7 @@ static void help (FILE * f, const char *name);
 static void version (FILE * f, const char *name);
 static void license (FILE * f, const char *name);
 
-static int
+static void
 usageCore (FILE * f, const char * name)
 {
   fprintf (f,
@@ -378,7 +378,7 @@ main (int argc, char **argv)
             ? " [logon_id]"  : ""));
          const struct group * g = strsid_to_group (strsid);
          if (g)
-           printf (" gid=%lu(%s)", g->gr_gid, g->gr_name);
+           printf (" gid=%u(%s)", (unsigned) g->gr_gid, g->gr_name);
          printf ("\n");
        }
 
@@ -415,7 +415,7 @@ main (int argc, char **argv)
        printf ("r   %s", strsid);
        const struct group * g = strsid_to_group (strsid);
        if (g)
-         printf (" gid=%lu(%s)", g->gr_gid, g->gr_name);
+         printf (" gid=%u(%s)", (unsigned) g->gr_gid, g->gr_name);
        printf ("\n");
       }
 
This page took 0.398727 seconds and 5 git commands to generate.