From f816b2a08651e665000d3e1e9f85b2c8ba6d9d85 Mon Sep 17 00:00:00 2001 From: turbocat Date: Tue, 8 Feb 2022 20:08:54 +0000 Subject: [PATCH] cmm: fixed bug with searching for input files. git-svn-id: svn://kolibrios.org@9706 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/develop/cmm/tokc.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/programs/develop/cmm/tokc.cpp b/programs/develop/cmm/tokc.cpp index 279a2cd41..a5975bd78 100644 --- a/programs/develop/cmm/tokc.cpp +++ b/programs/develop/cmm/tokc.cpp @@ -174,10 +174,14 @@ SAVEREG *psavereg=&savereg; int loadfile(char *filename,int firstflag) { -int hold; - + int hold; for(int i=0;i<=numfindpath;i++){ - sprintf((char *)string2,"%s%s",findpath[(firstflag==0?i:numfindpath-i)],filename); + char *path = findpath[(firstflag==0?i:numfindpath-i)]; // FIXME! (нужно выяснить, почему path может быть равен "\0") + if(path && strlen(path)) { + sprintf((char *)string2,"%s%s", path, filename); + } else { + strcpy((char *)string2, filename); + } #ifndef _WIN32_ for(char* p=(char *)string2; *p; ++p) if(*p=='\\') *p='/'; #endif