Files
gentoo/dev-embedded/pk2cmd/files/pk2cmd-add-share-dir-for-dev-file-1.20.patch
Jakov Smolić de88be4628 dev-embedded/pk2cmd: Port to EAPI 8
Closes: https://bugs.gentoo.org/828732
Signed-off-by: Jakov Smolić <jsmolic@gentoo.org>
2022-01-13 12:40:17 +01:00

17 lines
596 B
Diff

--- a/cmd_app.cpp
+++ b/cmd_app.cpp
@@ -88,7 +88,12 @@
_tsearchenv_s("PK2DeviceFile.dat", "PATH", tempString);
if (_tcslen(tempString) < 17)
{
- _tcsncpy_s(tempString, "PK2DeviceFile.dat", 17);
+ // Try /usr/share/pk2 first
+ _tcsncpy_s(tempString, "/usr/share/pk2/PK2DeviceFile.dat", 32);
+
+ if(access(tempString, 0))
+ // Well, that didn't work, default to the current directory
+ _tcsncpy_s(tempString, "PK2DeviceFile.dat", 17);
}
}
if (!PicFuncs.ReadDeviceFile(tempString))