diff options
author | midipix <writeonce@midipix.org> | 2018-11-10 17:06:29 -0500 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2018-11-10 17:35:32 -0500 |
commit | ca36f56b368ece9c0f3b276a456e5c5a7ce3c151 (patch) | |
tree | 7b23cbd37a2d2a60dc3b7257d3904abecba78e76 /src/logic | |
parent | 08f5f92f68aa6f198d401229061b39a4f9602769 (diff) | |
download | slibtool-ca36f56b368ece9c0f3b276a456e5c5a7ce3c151.tar.bz2 slibtool-ca36f56b368ece9c0f3b276a456e5c5a7ce3c151.tar.xz |
install mode: host flavors: properly support suffixed suffixes.
Diffstat (limited to 'src/logic')
-rw-r--r-- | src/logic/slbt_exec_install.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/src/logic/slbt_exec_install.c b/src/logic/slbt_exec_install.c index 9665dd4..0ab33a5 100644 --- a/src/logic/slbt_exec_install.c +++ b/src/logic/slbt_exec_install.c @@ -328,6 +328,7 @@ static int slbt_exec_install_entry( char * dot; char * base; char * slash; + char * suffix; char target [PATH_MAX]; char srcfile [PATH_MAX]; char dstfile [PATH_MAX]; @@ -489,19 +490,38 @@ static int slbt_exec_install_entry( if (frelease) return 0; - /* libfoo.so.x.y.z --> libfoo.so.x */ + /* libfoo.so.x --> libfoo.so.x.y.z */ strcpy(slnkname,target); - if ((dot = strrchr(slnkname,'.'))) - *dot = 0; + if ((suffix = strrchr(slnkname,'.'))) + *suffix++ = 0; else return SLBT_CUSTOM_ERROR(dctx,SLBT_ERR_INSTALL_FLOW); if ((dot = strrchr(slnkname,'.'))) - *dot = 0; + *dot++ = 0; else return SLBT_CUSTOM_ERROR(dctx,SLBT_ERR_INSTALL_FLOW); + if ((*dot < '0') || (*dot > '9')) + return SLBT_CUSTOM_ERROR(dctx,SLBT_ERR_INSTALL_FLOW); + + /* libfoo.x.y.z.so? */ + if ((suffix[0] < '0') || (suffix[0] > '9')) { + if ((dot = strrchr(slnkname,'.'))) + dot++; + else + return SLBT_CUSTOM_ERROR(dctx,SLBT_ERR_INSTALL_FLOW); + + if ((*dot < '0') || (*dot > '9')) + return SLBT_CUSTOM_ERROR(dctx,SLBT_ERR_INSTALL_FLOW); + + for (; *suffix; ) + *dot++ = *suffix++; + + *dot++ = 0; + } + /* destination symlink: dstdir/libfoo.so.x */ if ((size_t)snprintf(dlnkname,sizeof(dlnkname),"%s/%s", dstdir,slnkname) >= sizeof(dlnkname)) |