Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Possible Bug in Is()


5 replies to this topic

clvrmnky

clvrmnky
  • Members
  • 27 posts

Posted 12 February 2002 - 23:39

It looks like Is() has a bug in it.  The following call returns TRUE:

Is(VALID_PATH, "C:foo")

AFAIK, "c:foo" is NOT a valid Win32 pathname.  Well, it is an odd pathname, anyway.  Using the command prompt on Win2K, with the current working directory set to "C:\", I can invoke "cd c:foo", which will change the CWD to C:\foo.

Issuing the exact same command will cause a "cannot find path" error.  Even better, if I invoke the same command while in C:\Program Files, it will try to put me in C:\Program Files\foo.  Very odd.

Anyway, how do I verify that a path from SdAskDestPath() is any good?


Ide Nentjes

Ide Nentjes
  • Members
  • 222 posts

Posted 13 February 2002 - 10:04

Hi,

C:foo is a correct DOS syntax:

If you have multiple drives, then DOS keeps in memory the current directory for each drive. For example, if you are  on D:, and issue  MKDIR C:foo  , then in the current directory on C: a subdirectory called 'foo' is created.
Likewise, CD C:FOO in DOS means: "In the current directory on the C: drive, change to path to 'foo' "

Since C:foo is valid for CD and MKDIR, Is() sees it correctly as a valid path.

Ide


clvrmnky

clvrmnky
  • Members
  • 27 posts

Posted 13 February 2002 - 16:38

I figured as much after my investigation.  As far as I'm concerned, this is not a valid path for Is().  I'm finding that "c:foo" passed into SdAskDestPath() is hosing my install.

Since I have to write a custom "is this a good path" function anyway, I can basically throw Is(VALID_PATH,...) away.  In my opinion, an IS function should return TRUE in this case, only if IS can actually use such a PATH.


hmoeckel

hmoeckel
  • Full Members
  • 97 posts

Posted 13 April 2017 - 11:48

just found this entry in the forum.

 

There seems to be a bug in Is():

 

Is(VALID_PATH, "aaaaaaaaa") returns 1 as well, but it should return 0 as far as I can see.

 

So how is it possible to check a string if it's a valid directory name?

 

 



hmoeckel

hmoeckel
  • Full Members
  • 97 posts

Posted 13 April 2017 - 13:19

I solved my issue by using 'ParsePath'

 

ParsePath ( szTemp, "C:\\temp", DISK ); returns 1

ParsePath ( szTemp, "aaaaaaaaaaa", DISK ); returns 0



hmoeckel

hmoeckel
  • Full Members
  • 97 posts

Posted 13 April 2017 - 17:23

Sorry its like that:

ParsePath ( szTemp, "C:\\temp", DISK ); returns 0  and StrLength(szTemp) > 0

ParsePath ( szTemp, "aaaaaaaaaaa", DISK ); returns 0 and StrLength(szTemp) = 0