From: Charles Wilson Date: Mon, 16 Aug 2010 17:05:16 +0000 (+0000) Subject: cygstart: allow relative paths X-Git-Tag: v1_4_6~7 X-Git-Url: https://cygwin.com/git/?a=commitdiff_plain;h=c91963aa5d82e372760278e092a49819610c3ec1;p=cygwin-apps%2Fcygutils.git cygstart: allow relative paths --- diff --git a/ChangeLog b/ChangeLog index 5de3205..bbcafff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-08-16 Charles Wilson + + * cygstart.c (cygstart_posix_to_win_w): Use CCP_RELATIVE + when converting paths; enables 'cygstart calc'. Reported + by Ken Hirsch. + * NEWS: Document. + 2010-08-16 Charles Wilson * cygstart.1: Update URL for reference to MS 'ShellExecute' diff --git a/NEWS b/NEWS index 9fb7253..39a0087 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,9 @@ * ascii: by default, now only prints characters 0..127. Use new option --extended/-e for old behavior, printing characters 0..255. See this thread: http://cygwin.com/ml/cygwin/2010-04/msg00600.html + * cygstart: Fix --reference. Allow relative paths (enables, e.g. + 'cygstart calc'). Reported by Ken Hirsch. + http://cygwin.com/ml/cygwin/2010-01/msg01101.html * Updated license for lpr to GPLv3+ (with permission from Rick Rankin) * Updated license for readshortcut to GPLv3+ (with permission diff --git a/src/cygstart/cygstart.c b/src/cygstart/cygstart.c index e2b9708..fb757c8 100644 --- a/src/cygstart/cygstart.c +++ b/src/cygstart/cygstart.c @@ -489,7 +489,8 @@ static int cygstart_posix_to_win_w (const char *posix_mbs_path, wchar_t **w32_wcs_path) { int rc = 0; - ssize_t len = cygwin_conv_path (CCP_POSIX_TO_WIN_W, posix_mbs_path, NULL, 0); + ssize_t len = cygwin_conv_path (CCP_POSIX_TO_WIN_W|CCP_RELATIVE, + posix_mbs_path, NULL, 0); if (len < 0) { fprintf (stderr, @@ -507,7 +508,8 @@ cygstart_posix_to_win_w (const char *posix_mbs_path, wchar_t **w32_wcs_path) goto err_cleanup; } - if (cygwin_conv_path (CCP_POSIX_TO_WIN_W, posix_mbs_path, *w32_wcs_path, + if (cygwin_conv_path (CCP_POSIX_TO_WIN_W|CCP_RELATIVE, + posix_mbs_path, *w32_wcs_path, (len + 1) * sizeof (wchar_t)) < 0) { fprintf (stderr,