On Tue, Jul 26, 2016 at 23:38:34 +0200, Sebastian Holtermann wrote:
> Doing so I found that Base64 allows '+' and '/' as characters which is 
> bad for directory names obviously.
> For now these characters get replaced with 'A' and 'B'.

'_' and '@' would be better replacements (with comments why they are
used) since 'A' and 'B' are already characters in Base64.

> +            // unexpected hexchar

This raise an internal error, not just be a comment.

> +          }
> +        }
> +        hashBytes[ii] = hbyte[0] | (hbyte[1] << 4);
> +      }
> +    }
> +    // Convert hash bytes to Base64 text string
> +    {
> +      std::vector<unsigned char> base64Bytes(hashBytes.size() * 2, 0);
> +      cmsysBase64_Encode(&hashBytes[0], hashBytes.size(), &base64Bytes[0], 
> 0);
> +      checksumBase64 = reinterpret_cast<const char*>(&base64Bytes[0]);
> +      // Base64 allows '+' and '/' characters. Replace these.

This comment should indicate it is because the string is used as part of
a path and that these characters tend to cause problems in paths.

--Ben
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to