This is the mail archive of the
cygwin-apps-cvs
mailing list for the cygwin-apps project.
[cygutils] branch master, updated. c3bb28d5d9a59bfc809b91d8205cd27a76f823cd
- From: mgeisert at sourceware dot org
- To: cygwin-apps-cvs at sourceware dot org
- Date: 12 Nov 2015 08:31:37 -0000
- Subject: [cygutils] branch master, updated. c3bb28d5d9a59bfc809b91d8205cd27a76f823cd
https://sourceware.org/git/gitweb.cgi?p=cygwin-cygutils.git;h=c3bb28d5d9a59bfc809b91d8205cd27a76f823cd
commit c3bb28d5d9a59bfc809b91d8205cd27a76f823cd
Author: Mark Geisert <mark@maxrnd.com>
Date: Tue Nov 3 02:37:50 2015 -0800
version 1.4.15
Diff:
---
BRANCHES | 2 ++
ChangeLog | 15 ++++++++++++++-
NEWS | 11 +++++++++++
configure.ac | 2 +-
src/cygdrop/cygdrop.cc | 4 ++--
src/lpr/Printer.cc | 6 +++---
src/mkshortcut/mkshortcut.c | 16 ++++++++++++++--
7 files changed, 47 insertions(+), 9 deletions(-)
diff --git a/BRANCHES b/BRANCHES
index c36f39f..3f1d629 100644
--- a/BRANCHES
+++ b/BRANCHES
@@ -100,3 +100,5 @@ v1_4_12
v1_4_13 (devel)
|
v1_4_14
+ |
+v1_4_15
diff --git a/ChangeLog b/ChangeLog
index 2c57ead..620dec0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,20 @@
+2015-11-03 Mark Geisert <mark@maxrnd.com>
+
+ Release 1.4.15
+ * configure.ac: Bump version number to 1.4.15.
+ * BRANCHES: Ditto.
+ * src/cygdrop/cygdrop.cc (match_priv): strcmpi() -> strcasecmp().
+ * src/lpr/Printer.cc (::mapPortName): stricmp() -> strcasecmp().
+ * src/mkshortcut/mkshortcut.cc: Don't free() adjusted pointer.
+ Also handle changed Windows behavior when saving link to relative
+ path; evident after Windows 7. Reporter Anthony Heading refers to
+ https://msdn.microsoft.com/en-us/
+ library/windows/desktop/hh848036%28v=vs.85%29.aspx
+
2013-07-28 Charles Wilson <cwilson@...>
Release 1.4.14
- * configure.ac: Bump version number to 1.4.12.
+ * configure.ac: Bump version number to 1.4.14.
Update to latest autoconf/automake.
* BRANCHES: Ditto.
diff --git a/NEWS b/NEWS
index 88144a1..917ec11 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,14 @@
+1.4.15
+ New maintainer Mark Geisert <mark@maxrnd.com>.
+ Source code master converted from CVS to Git, still hosted at sourceware.
+ * cygdrop: Replace strcmpi() calls with strcasecmp().
+ * lpr: Replace stricmp() calls with strcasecmp().
+ * mkshortcut: Fix seg fault due to freeing adjusted pointer. Patch from
+ reporter Anthony Heading.
+ * mkshortcut: Handle changed Windows behavior when saving a link to a
+ relative path; change evident after Windows 7. Patch from reporter
+ Anthony Heading.
+
1.4.14
* cygdrop: Fix bug in obtaining security token information
Patch from Corinna Vinschen, reported by Achim Gratz.
diff --git a/configure.ac b/configure.ac
index 9e703b2..2b6d1cd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.69)
-AC_INIT(cygutils, 1.4.14, cygwin@cygwin.com)
+AC_INIT(cygutils, 1.4.15, cygwin@cygwin.com)
AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
diff --git a/src/cygdrop/cygdrop.cc b/src/cygdrop/cygdrop.cc
index b71a138..35bcc19 100644
--- a/src/cygdrop/cygdrop.cc
+++ b/src/cygdrop/cygdrop.cc
@@ -171,11 +171,11 @@ match_strsid (const char * strsid, const char * pattern)
static bool
match_priv (const char * priv, const char * pattern)
{
- if (!strcmpi (priv, pattern))
+ if (!strcasecmp (priv, pattern))
return true;
char buf[strlen (pattern) + 16];
sprintf (buf, "Se%sPrivilege", pattern);
- return !strcmpi (priv, buf);
+ return !strcasecmp (priv, buf);
}
/* use long options for standard options, for
diff --git a/src/lpr/Printer.cc b/src/lpr/Printer.cc
index 2dd0b8b..98dab60 100644
--- a/src/lpr/Printer.cc
+++ b/src/lpr/Printer.cc
@@ -225,7 +225,7 @@ void Printer::mapPortName() throw(PrinterException)
PrinterList list = enumPrinters(PRINTER_ENUM_NAME, empty);
for (PrinterList::iterator it = list.begin(); it != list.end(); ++it)
{
- if (stricmp(m_devName.c_str(), it->pPortName) == 0)
+ if (strcasecmp(m_devName.c_str(), it->pPortName) == 0)
{
if (m_debugFlag)
cout << "Mapped '" << m_devName << "' to '" << it->pPrinterName
@@ -241,7 +241,7 @@ void Printer::mapPortName() throw(PrinterException)
PrinterList list = enumPrinters(PRINTER_ENUM_LOCAL, 0);
for (PrinterList::iterator it = list.begin(); it != list.end(); ++it)
{
- if (stricmp(m_devName.c_str(), it->pPortName) == 0)
+ if (strcasecmp(m_devName.c_str(), it->pPortName) == 0)
{
if (m_debugFlag)
cout << "Mapped '" << m_devName << "' to '" << it->pPrinterName
@@ -254,7 +254,7 @@ void Printer::mapPortName() throw(PrinterException)
list = enumPrinters(PRINTER_ENUM_CONNECTIONS, 0);
for (PrinterList::iterator it = list.begin(); it != list.end(); ++it)
{
- if (stricmp(m_devName.c_str(), it->pPortName) == 0)
+ if (strcasecmp(m_devName.c_str(), it->pPortName) == 0)
{
if (m_debugFlag)
cout << "Mapped '" << m_devName << "' to '" << it->pPrinterName
diff --git a/src/mkshortcut/mkshortcut.c b/src/mkshortcut/mkshortcut.c
index ebb7a31..6707eb4 100644
--- a/src/mkshortcut/mkshortcut.c
+++ b/src/mkshortcut/mkshortcut.c
@@ -412,7 +412,7 @@ mkshortcut (optvals opts)
char* exe_name = NULL;
char* dir_name = NULL;
char* desc = NULL;
- char *buf_str, *tmp_str;
+ char *buf_str, *tmp_str, *base_str;
int tmp;
/* For OLE interface */
@@ -421,6 +421,7 @@ mkshortcut (optvals opts)
IShellLink *shell_link;
IPersistFile *persist_file;
WCHAR widepath[MAX_PATH];
+ char link_path[MAX_PATH];
/* If there's a colon in the TARGET, it should be a URL */
if (strchr (opts.target_arg, ':') != NULL)
@@ -489,6 +490,7 @@ mkshortcut (optvals opts)
{
/* Strip trailing /'s if any */
buf_str = xstrndup (opts.target_arg, strlen(opts.target_arg));
+ base_str = buf_str;
tmp_str = buf_str;
tmp = strlen (buf_str) - 1;
while (strrchr (buf_str, '/') == (buf_str + tmp))
@@ -504,7 +506,7 @@ mkshortcut (optvals opts)
buf_str++;
}
link_name = xstrndup (tmp_str, strlen (tmp_str));
- free (buf_str);
+ free (base_str);
}
/* User specified a name, so check it and convert */
else
@@ -596,6 +598,16 @@ mkshortcut (optvals opts)
free (buf_str);
}
+ /* After Windows 7, saving link to relative path fails; work around that */
+ hres = GetFullPathName (link_name, sizeof (link_path), link_path, 0);
+ if (hres == 0)
+ {
+ fprintf (stderr, "%s: Could not qualify link name\n", program_name);
+ return 2;
+ }
+ free (link_name);
+ link_name = xstrndup (link_path, strlen (link_path));
+
/* Setup description text */
if (opts.desc_arg != NULL)
{