From 6b8cf01ef57ecfaf18d2ef8b11e898875790686a Mon Sep 17 00:00:00 2001 From: Steven Watanabe Date: Thu, 1 Dec 2011 19:34:06 +0000 Subject: [PATCH] Short circuit test if a file exists, when the name contains a grist. [SVN r75765] --- v2/engine/pathunix.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/v2/engine/pathunix.c b/v2/engine/pathunix.c index 0f6c751ec..e80e46260 100644 --- a/v2/engine/pathunix.c +++ b/v2/engine/pathunix.c @@ -384,13 +384,21 @@ DWORD ShortPathToLongPath(LPCTSTR lpszShortPath,LPTSTR lpszLongPath,DWORD OBJECT * short_path_to_long_path( OBJECT * short_path ) { - char buffer2[_MAX_PATH]; - int ret = ShortPathToLongPath( object_str( short_path ), buffer2, _MAX_PATH ); - - if (ret) - return object_new( buffer2 ); + /* Short circuit names with grists. */ + if ( object_str( short_path )[ 0 ] == '<' ) + { + return object_copy( short_path ); + } else - return object_copy( short_path ); + { + char buffer2[_MAX_PATH]; + int ret = ShortPathToLongPath( object_str( short_path ), buffer2, _MAX_PATH ); + + if (ret) + return object_new( buffer2 ); + else + return object_copy( short_path ); + } } #endif