[cmake-developers] Autogen subdirectories patches

Sebastian Holtermann seblist at xwmw.org
Wed Jul 27 12:52:15 EDT 2016


Am 27.07.2016 um 17:49 schrieb Sebastian Holtermann:
>
>>> 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.
>
> Some quick research (aka googling) revealed
> http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_278
>
> It seems '_' and '-' are safer choices.
>
>>> +            // unexpected hexchar
>>
>> This raise an internal error, not just be a comment.
>
> Is there an error exit function in CMake?
> Or just exit(-1);
>
>>> +          }
>>> +        }
>>> +        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.
>
> Ok.
>

The patch.

-Sebastian


-------------- next part --------------
A non-text attachment was scrubbed...
Name: autogen_patch_2016-07-27-1.patch
Type: text/x-patch
Size: 18574 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20160727/f4d9b8aa/attachment.bin>


More information about the cmake-developers mailing list