Kaydet (Commit) 54a67933 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Remove code that has been commented-out for long

Commented-out in a198aa60 in 2005.

Change-Id: Id174dae6632fa8d8e9845b06b916a8515cd6acf3
üst 78f0d158
......@@ -133,75 +133,6 @@ static BOOL IsValidFilePathComponent(
lpComponentEnd = lpCurrent;
}
/* Test whether the component specifies a device name what is not allowed */
// MT: PERFORMANCE:
// This is very expensive. A lot of calls to _tcsicmp.
// in SRC6870m71 67.000 calls of this method while empty office start result into more than 1.500.00 calls of _tcsicmp!
// Possible optimizations
// - Array should be const static
// - Sorted array, use binary search
// - More intelligent check for com1-9, lpt1-9
// Maybe make szComponent upper case, don't search case insensitive
// Talked to HRO: Could be removed. Shouldn't be used in OOo, and if used for something like a filename, it will lead to an error anyway.
/*
if ( fValid )
{
LPCWSTR alpDeviceNames[] =
{
TEXT("CON"),
TEXT("PRN"),
TEXT("AUX"),
TEXT("CLOCK$"),
TEXT("NUL"),
TEXT("LPT1"),
TEXT("LPT2"),
TEXT("LPT3"),
TEXT("LPT4"),
TEXT("LPT5"),
TEXT("LPT6"),
TEXT("LPT7"),
TEXT("LPT8"),
TEXT("LPT9"),
TEXT("COM1"),
TEXT("COM2"),
TEXT("COM3"),
TEXT("COM4"),
TEXT("COM5"),
TEXT("COM6"),
TEXT("COM7"),
TEXT("COM8"),
TEXT("COM9")
};
WCHAR szComponent[MAX_PATH];
int nComponentLength;
LPCWSTR lpDot;
int i;
// A device name with an extension is also invalid
lpDot = _tcschr( lpComponent, '.' );
if ( !lpDot || lpDot > lpComponentEnd )
nComponentLength = lpComponentEnd - lpComponent;
else
nComponentLength = lpDot - lpComponent;
_tcsncpy( szComponent, lpComponent, nComponentLength );
szComponent[nComponentLength] = 0;
for ( i = 0; i < sizeof( alpDeviceNames ) / sizeof(LPCWSTR); i++ )
{
if ( 0 == _tcsicmp( szComponent, alpDeviceNames[i] ) )
{
lpComponentEnd = lpComponent;
fValid = FALSE;
break;
}
}
}
*/
if ( fValid )
{
// Empty components are not allowed
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment