Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r80092 - trunk/tools/build/v2/engine
From: jurko.gospodnetic_at_[hidden]
Date: 2012-08-20 07:54:11


Author: jurko
Date: 2012-08-20 07:54:10 EDT (Mon, 20 Aug 2012)
New Revision: 80092
URL: http://svn.boost.org/trac/boost/changeset/80092

Log:
Boost Jam cleanup - there is no need to convert a short Windows path to its long format except to generate that path's canonic format, i.e. to get the same value for the same file system entry, independent of the original path string used to identify that entry. To get closer to that effect in the ShortPathToLongPath() function, we remove a recently added optimization of not processing file/folder names that are certainly not in their short format. By processing such names we can correctly remove more unimportant case differences between different path strings representing the same file system entry, i.e. get the same canonic path string for them.
Text files modified:
   trunk/tools/build/v2/engine/pathunix.c | 54 ---------------------------------------
   1 files changed, 1 insertions(+), 53 deletions(-)

Modified: trunk/tools/build/v2/engine/pathunix.c
==============================================================================
--- trunk/tools/build/v2/engine/pathunix.c (original)
+++ trunk/tools/build/v2/engine/pathunix.c 2012-08-20 07:54:10 EDT (Mon, 20 Aug 2012)
@@ -258,48 +258,6 @@
 
 
 /*
- * may_be_a_valid_short_name() - returns whether the given file name may be a
- * valid Windows short name, i.e. whether it might have a different long name.
- */
-
-static int may_be_a_valid_short_name( char const * const n, int const n_length )
-{
- char const * p;
- char const * const n_end = n + n_length;
- char const * dot = 0;
-
- /* Short names have at most 12 characters (8 + dot + 3). */
- if ( n_length > 12 )
- return 0;
-
- for ( p = n; p != n_end; ++p )
- switch ( *p )
- {
- case ' ':
- /* Short names may not contain spaces. */
- return 0;
-
- case '.':
- /* Short name may contain at most one dot. */
- if ( dot )
- return 0;
- dot = p;
- /* Short name base must have at least one character. */
- if ( dot == n )
- return 0;
- /* Short name base may not be longer than 8 characters. */
- if ( dot - n > 8 )
- return 0;
- /* Short name extension may not be longer than 3 characters. */
- if ( n_end - dot - 1 > 3 )
- return 0;
- }
-
- return 1;
-}
-
-
-/*
  * ShortPathToLongPath() - convert a given path into its long format
  *
  * In the process, automatically registers long paths for all of the parent
@@ -377,21 +335,11 @@
     saved_size = out->size;
     string_append_range( out, last_element, path + path_length );
 
- /* If we have a name that can not be a valid short name then it must be a
- * valid long name and we are done. If there is a chance this is not the
- * file's long name, ask the OS for the file's actual long name. We try to
- * avoid this file system access as it could be unnecessarily expensive.
- * Note that there is no way to detect the file's 'long name' in case it
- * does not already exist, in which case in theory a file could later be
- * created that has a different long name and the name given here as its
- * short name.
- */
     {
         char const * const n = last_element;
         int const n_length = path + path_length - n;
         if ( !( n_length == 1 && n[ 0 ] == '.' )
- && !( n_length == 2 && n[ 0 ] == '.' && n[ 1 ] == '.' )
- && may_be_a_valid_short_name( n, n_length ) )
+ && !( n_length == 2 && n[ 0 ] == '.' && n[ 1 ] == '.' ) )
         {
             WIN32_FIND_DATA fd;
             HANDLE const hf = FindFirstFile( out->value, &fd );


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk