--- libelwix/src/av.c 2015/06/25 17:53:50 1.3 +++ libelwix/src/av.c 2018/05/31 15:35:16 1.4 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: av.c,v 1.3 2015/06/25 17:53:50 misho Exp $ +* $Id: av.c,v 1.4 2018/05/31 15:35:16 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -12,7 +12,7 @@ terms: All of the documentation and software included in the ELWIX and AITNET Releases is copyrighted by ELWIX - Sofia/Bulgaria -Copyright 2004 - 2015 +Copyright 2004 - 2018 by Michael Pounov . All rights reserved. Redistribution and use in source and binary forms, with or without @@ -156,6 +156,9 @@ av_Path2File(const char * __restrict csArgs, char * __ pos = strrchr(psBuf, '/'); if (!pos) { + if (psPath) + strlcpy(psPath, ".", pathLen); + strlcpy(psFile, psBuf, fileLen); e_free(psBuf); @@ -165,7 +168,7 @@ av_Path2File(const char * __restrict csArgs, char * __ strlcpy(psFile, pos, fileLen); if (psPath) - strlcpy(psPath, psBuf, pathLen); + strlcpy(psPath, *psBuf ? psBuf : "/", pathLen); e_free(psBuf); return 2;