* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: dos8dot3.c,v 1.1 2002/06/05 16:50:43 ekohl Exp $
+/* $Id: dos8dot3.c,v 1.2 2002/06/06 16:17:09 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
if ((Context->NameLength == CopyLength) &&
(wcsncmp(Context->NameBuffer, NameBuffer, CopyLength) == 0) &&
- (Context->ExtensionLength = ExtLength) &&
+ (Context->ExtensionLength == ExtLength) &&
(wcsncmp(Context->ExtensionBuffer, ExtBuffer, ExtLength) == 0))
CurrentIndex = Context->LastIndexValue + 1;
else
break;
case '.':
- if ((HasDot) || /* two dots */
- (!i) || /* point is first char */
- (i + 1 == Length) ||/* point is last char */
- (Length - i > 4)) /* more than 3 chars of extension */
+ if ((HasDot) || /* two or more dots */
+ (i == 0) || /* dot is first char */
+ (i + 1 == Length) || /* dot is last char */
+ (Length - i > 4) || /* more than 3 chars of extension */
+ (HasDot == FALSE && i > 8)) /* name is longer than 8 chars */
return(FALSE);
HasDot = TRUE;
break;
}
}
+ /* Name is longer than 8 chars and does not have an extension */
+ if (Length > 8 && HasDot == FALSE)
+ {
+ return(FALSE);
+ }
+
if (SpacesFound)
*SpacesFound = HasSpace;
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: dos8dot3.c,v 1.1 2002/06/05 16:52:43 ekohl Exp $
+/* $Id: dos8dot3.c,v 1.2 2002/06/06 16:17:26 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
CopyLength = min(NameLength, (CurrentIndex < 10) ? 6 : 5);
if ((Context->NameLength == CopyLength) &&
(wcsncmp(Context->NameBuffer, NameBuffer, CopyLength) == 0) &&
- (Context->ExtensionLength = ExtLength) &&
+ (Context->ExtensionLength == ExtLength) &&
(wcsncmp(Context->ExtensionBuffer, ExtBuffer, ExtLength) == 0))
CurrentIndex = Context->LastIndexValue + 1;
else
break;
case '.':
- if ((HasDot) || /* two dots */
- (!i) || /* point is first char */
- (i + 1 == Length) ||/* point is last char */
- (Length - i > 4)) /* more than 3 chars of extension */
+ if ((HasDot) || /* two or more dots */
+ (i == 0) || /* dot is first char */
+ (i + 1 == Length) || /* dot is last char */
+ (Length - i > 4) || /* more than 3 chars of extension */
+ (HasDot == FALSE && i > 8)) /* name is longer than 8 chars */
return(FALSE);
HasDot = TRUE;
break;
}
}
+ /* Name is longer than 8 chars and does not have an extension */
+ if (Length > 8 && HasDot == FALSE)
+ {
+ return(FALSE);
+ }
+
if (SpacesFound)
*SpacesFound = HasSpace;