X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-1.0 required=5.0	tests=AWL,BAYES_20,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,TW_TF,T_TO_NO_BRKTS_FREEMAIL
X-Spam-Check-By: sourceware.org
Message-Id: <E4ED178C-CF07-4B62-A65E-F758F1D56D3A@free.fr>
From: Denis Excoffier <Denis.Excoffier@free.fr>
To: cygwin@cygwin.com
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
Content-Transfer-Encoding: 7bit
Mime-Version: 1.0 (Apple Message framework v936)
Subject: readshortcut: print Target in raw format
Date: Tue, 4 May 2010 20:17:21 +0200
Cc: Denis Excoffier <Denis.Excoffier@free.fr>
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com


Hello,

On my Cygwin system (XP) i have (probably like most of you) the  
following
commands:
1) readshortcut.exe, from the package cygutils-1.4.2
2) SHORTCUT.EXE, from %windir%/system32 (or equivalent)

They are both consistent: in case of a `Target' that contains an
environment variable, the variable is resolved, for example:

% readshortcut -tfw X-Cygwin.bat.lnk
Target: C:\Users\me\me\cygwin2010b\Cygwin.bat
% /cygdrive/c/winnt/system32/SHORTCUT.EXE -u t X-Cygwin.bat.lnk
Target: C:\Users\me\me\cygwin2010b\Cygwin.bat

However, in the `Properties' of the Shortcut, i can read in the Target
cell:
`%myhome%\cygwin2010b\Cygwin.bat'
I would have preferred readshortcut.exe to show this raw path, with
the environment variable %myhome% still unresolved.

So i went into cygutils-1.4.2/src/readshortcut/readshortcut.c and
discovered that, if the last argument of GetPath() is set to
`SLGP_RAWPATH' (this is ok), the value of SLGP_RAWPATH is
obtained from `#include <shlobj.h>' (this is still ok), but it is
redefined later with `#define SLGP_RAWPATH 0' (this is *not* ok,
it should be 4).

It seems that the intentions of the original writer were to
print the raw path, but someone later changed that to be consistent
with SHORTCUT.EXE (or due to some other reason).

Please modify readshortcut.exe in order to be able to really print the
raw path (e.g. with an extra option). Thanks in advance.

Regards.

Denis Excoffier.


--
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

