fix mistake in wildcards processing if name contains one wildcard character on the name end then opendir reported error (not found).
small improvement of code