License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

This would be easy to add, however if you were using it on a hostmask instead of a file and tried to match "*.*" and you really want the '.' to be there it would not give you the desired results. So here would be my workaround..

I stumbled upon this thread looking for something completely different, but noticed that someone needed a little help

The easiest way to make the function compatible with DOS patterns without breaking the intended functionallity of the wildcmp() function is to simply add a wrapper function that adds a dot character at the end of strings that do not already have a dot and then call the wildcmp() function.

Please note: This is a very simple 'hack', but serves it purpose well. The STL string class offers so much more security than plain old char pointers, but that was just a side-note

The reason a command like "dir *.*" in DOS, or a Windows DOS box, will also yield files that have no extension, is that, well, even without an extension, the dot is still there. You CAN'T have a filename without a dot in it under DOS or Windows, that's just the way the file systems (FAT, NTFS, others) work.

The reason you can still do something like "type bleh" to get the contents of the file "bleh." is because DOS is so clever - it knows that there's supposed to be a dot there, even if the user forgot to type it in.