mirror of
https://git.freebsd.org/ports.git
synced 2025-06-13 08:40:39 -04:00
Also regen 'pkg-plist' for affected consumers, with PORTREVISION bump Touch Mk/bsd.ruby.mk due to all ruby* is affected MFH: 2021Q2
39 lines
1.3 KiB
Text
39 lines
1.3 KiB
Text
--- src/util.cpp.orig 2020-12-26 14:29:40 UTC
|
|
+++ src/util.cpp
|
|
@@ -25,6 +25,7 @@
|
|
#include <mutex>
|
|
#include <unordered_set>
|
|
|
|
+#include <sys/types.h>
|
|
#include "md5.h"
|
|
|
|
#include <qregexp.h>
|
|
@@ -3812,24 +3813,18 @@ QCString convertNameToFile(const char *name,bool allow
|
|
if (resultLen>=128) // prevent names that cannot be created!
|
|
{
|
|
// third algorithm based on MD5 hash
|
|
- uchar md5_sig[16];
|
|
QCString sigStr(33);
|
|
- MD5Buffer((const unsigned char *)result.data(),resultLen,md5_sig);
|
|
- MD5SigToString(md5_sig,sigStr.rawData(),33);
|
|
+ MD5Data((const unsigned char *)result.data(),resultLen,sigStr.rawData());
|
|
result=result.left(128-32)+sigStr;
|
|
}
|
|
}
|
|
if (createSubdirs)
|
|
{
|
|
- int l1Dir=0,l2Dir=0;
|
|
-
|
|
// compute md5 hash to determine sub directory to use
|
|
- uchar md5_sig[16];
|
|
- MD5Buffer((const unsigned char *)result.data(),result.length(),md5_sig);
|
|
- l1Dir = md5_sig[14]&0xf;
|
|
- l2Dir = md5_sig[15];
|
|
+ char md5[33];
|
|
+ MD5Data((const unsigned char *)result.data(),result.length(),md5);
|
|
|
|
- result.prepend(QCString().sprintf("d%x/d%02x/",l1Dir,l2Dir));
|
|
+ result.prepend(QCString().sprintf("d%c/d%c%c/",md5[29],md5[30],md5[31]));
|
|
}
|
|
//printf("*** convertNameToFile(%s)->%s\n",name,result.data());
|
|
return result;
|