public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Anthony Heading <anthony@ajrh.net>
To: Mark Geisert <mark@maxrnd.com>, cygwin@cygwin.com
Subject: Re: mkshortcut (cygutils-1.4.14) free error
Date: Tue, 27 Oct 2015 08:46:00 -0000	[thread overview]
Message-ID: <1445904708.1171081.420968713.3D94007E@webmail.messagingengine.com> (raw)
In-Reply-To: <loom.20151026T205200-829@post.gmane.org>

On Mon, Oct 26, 2015, at 03:54 PM, Mark Geisert wrote:
> There are configure errors from this process, at least on my
> machine. I'll take on maintenance of this package.  Give me a short
> while to get my sea legs.  Thanks Ken for the pointers and Corinna
> for the nudge.

Thanks Mark.   I would try to suggest you beat me to the punch but the
truth is you're much more noble.

I didn't hit any explicit configure issue myself,  rather a bunch of
unrecognized case-invariant strcmp variants, which took about 10 seconds
to fix but did make me wonder about the source code.    And then this
below was the slightly trickier issue:

% src/mkshortcut/.libs/mkshortcut xyzzy
mkshortcut: Saving "xyzzy.lnk" failed; does the target directory exist?

The packaged binary does not do this.

Fiddling about with various command-line flags suggests the issue is
with saving the link to a non-absolute path;  Google sort of vaguely
implies that IPersistFile may have changed semantics starting in Windows
8, but the docs I have say the Save() path should be absolute.   So I
added the minimal patch below.   At least, I think it's minimal, but I'd
certainly defer to you as the new maintainer!    Anyhow, attached below
fwiw in case it's of any help.

Rgds

Anthony

--- mkshortcut.c.orig   2015-10-17 21:57:08.000000000 -0400
+++ mkshortcut.c        2015-10-17 23:52:50.723030500 -0400
@@ -421,6 +421,7 @@
   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)
@@ -596,6 +598,14 @@
       free (buf_str);
     }
 
+  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)
     {

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

  reply	other threads:[~2015-10-27  0:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-18  2:30 Anthony Heading
2015-10-26 10:01 ` Anthony Heading
2015-10-26 10:08   ` Mark Geisert
2015-10-26 10:36     ` Corinna Vinschen
2015-10-27  5:29     ` Anthony Heading
2015-10-26 16:03   ` Ken Brown
2015-10-27  0:11     ` Mark Geisert
2015-10-27  8:46       ` Anthony Heading [this message]
2015-10-27  9:30         ` Mark Geisert
2015-10-28  4:49           ` Anthony Heading
2015-10-28  9:15             ` Mark Geisert
2015-10-28 13:05               ` Corinna Vinschen
2015-10-28 14:49                 ` Mark Geisert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1445904708.1171081.420968713.3D94007E@webmail.messagingengine.com \
    --to=anthony@ajrh.net \
    --cc=cygwin@cygwin.com \
    --cc=mark@maxrnd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).