James Hawkins truiken@gmail.com writes:
/* Generate a path with wildcard suitable for iterating */
if (CharPrevA(szFilename, szFilename + iLen) != "\\")
{
I don't think this means what you think it means ;-)
On 12/1/05, Alexandre Julliard julliard@winehq.org wrote:
James Hawkins truiken@gmail.com writes:
/* Generate a path with wildcard suitable for iterating */
if (CharPrevA(szFilename, szFilename + iLen) != "\\")
{
I don't think this means what you think it means ;-)
I thought about the comment when I was looking over it, thinking it might be misleading, and I decided that it applies to the block of code that is all of
+ /* Generate a path with wildcard suitable for iterating */ + if (CharPrevA(szFilename, szFilename + iLen) != "\") + { + lstrcatA(szFilename, "\"); + iLen++; + }
- /* TODO: Should check for system directory deletion etc. here */ + lstrcatA(szFilename, "*");
When the filename is a directory and the end of the string is not , append it, and we add * to the end no matter what so we can iterate through the files in the dir using Find*File. It's also possible to make the check as
if (szFilename[iLen] != '\')...
if the check is what's wrong. Am I missing something?
-- James Hawkins
Hi,
On Thu, Dec 01, 2005 at 02:45:37PM +0000, James Hawkins wrote:
On 12/1/05, Alexandre Julliard julliard@winehq.org wrote:
James Hawkins truiken@gmail.com writes:
/* Generate a path with wildcard suitable for iterating */
if (CharPrevA(szFilename, szFilename + iLen) != "\\")
{
I don't think this means what you think it means ;-)
if the check is what's wrong. Am I missing something?
Yup, you're missing a lot :)
String pointer address comparisons don't really make a lot of sense...
Andreas
On Thu, 01 Dec 2005 11:28:29 +0100, Alexandre Julliard wrote:
/* Generate a path with wildcard suitable for iterating */
if (CharPrevA(szFilename, szFilename + iLen) != "\\")
{
James, it should be
if (CharPrevA(szFilename, szFilename + iLen) != '\') { }
Note the single quotes, which makes this a character instead of a string (so it can be compared using !=). Yes, C is a very silly language indeed. You need to use '' when strcatting as well, if you are actually dealing with backslashes.
(and yeah, I've made the same mistake too before ... Wine is a great way to learn C ;)
thanks -mike