Fixed another silly bug.

svn path=/trunk/; revision=3015
This commit is contained in:
Eric Kohl 2002-06-06 18:59:50 +00:00
parent 51fddda8d4
commit cf6fb9b64c
2 changed files with 10 additions and 9 deletions

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: dos8dot3.c,v 1.2 2002/06/06 16:17:09 ekohl Exp $ /* $Id: dos8dot3.c,v 1.3 2002/06/06 18:57:55 ekohl Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries * PROJECT: ReactOS system libraries
@ -105,11 +105,9 @@ RtlGenerate8dot3Name(IN PUNICODE_STRING Name,
NameBuffer[NameLength++] = RtlUpcaseUnicodeChar(Name->Buffer[i]); NameBuffer[NameLength++] = RtlUpcaseUnicodeChar(Name->Buffer[i]);
} }
} }
DPRINT("NameBuffer: '%.08S'\n", NameBuffer); DPRINT("NameBuffer: '%.08S'\n", NameBuffer);
DPRINT("NameLength: %hu\n", NameLength); DPRINT("NameLength: %hu\n", NameLength);
/* Copy extension (4 valid characters max) */ /* Copy extension (4 valid characters max) */
if (DotPos < StrLength) if (DotPos < StrLength)
{ {
@ -125,13 +123,15 @@ RtlGenerate8dot3Name(IN PUNICODE_STRING Name,
DPRINT("ExtBuffer: '%.04S'\n", ExtBuffer); DPRINT("ExtBuffer: '%.04S'\n", ExtBuffer);
DPRINT("ExtLength: %hu\n", ExtLength); DPRINT("ExtLength: %hu\n", ExtLength);
/* Determine next index */
CurrentIndex = Context->LastIndexValue;
CopyLength = min(NameLength, (CurrentIndex < 10) ? 6 : 5); CopyLength = min(NameLength, (CurrentIndex < 10) ? 6 : 5);
if ((Context->NameLength == CopyLength) && if ((Context->NameLength == CopyLength) &&
(wcsncmp(Context->NameBuffer, NameBuffer, CopyLength) == 0) && (wcsncmp(Context->NameBuffer, NameBuffer, CopyLength) == 0) &&
(Context->ExtensionLength == ExtLength) && (Context->ExtensionLength == ExtLength) &&
(wcsncmp(Context->ExtensionBuffer, ExtBuffer, ExtLength) == 0)) (wcsncmp(Context->ExtensionBuffer, ExtBuffer, ExtLength) == 0))
CurrentIndex = Context->LastIndexValue + 1; CurrentIndex++;
else else
CurrentIndex = 1; CurrentIndex = 1;

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: dos8dot3.c,v 1.2 2002/06/06 16:17:26 ekohl Exp $ /* $Id: dos8dot3.c,v 1.3 2002/06/06 18:59:50 ekohl Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -121,12 +121,15 @@ RtlGenerate8dot3Name(IN PUNICODE_STRING Name,
DPRINT("ExtLength: %hu\n", ExtLength); DPRINT("ExtLength: %hu\n", ExtLength);
/* Determine next index */ /* Determine next index */
CurrentIndex = Context->LastIndexValue;
CopyLength = min(NameLength, (CurrentIndex < 10) ? 6 : 5); CopyLength = min(NameLength, (CurrentIndex < 10) ? 6 : 5);
DPRINT("CopyLength: %hu\n", CopyLength);
if ((Context->NameLength == CopyLength) && if ((Context->NameLength == CopyLength) &&
(wcsncmp(Context->NameBuffer, NameBuffer, CopyLength) == 0) && (wcsncmp(Context->NameBuffer, NameBuffer, CopyLength) == 0) &&
(Context->ExtensionLength == ExtLength) && (Context->ExtensionLength == ExtLength) &&
(wcsncmp(Context->ExtensionBuffer, ExtBuffer, ExtLength) == 0)) (wcsncmp(Context->ExtensionBuffer, ExtBuffer, ExtLength) == 0))
CurrentIndex = Context->LastIndexValue + 1; CurrentIndex++;
else else
CurrentIndex = 1; CurrentIndex = 1;
DPRINT("CurrentIndex: %hu\n", CurrentIndex); DPRINT("CurrentIndex: %hu\n", CurrentIndex);
@ -243,6 +246,4 @@ RtlIsNameLegalDOS8Dot3(IN PUNICODE_STRING UnicodeName,
return(TRUE); return(TRUE);
} }
/* EOF */
/* EOF */