static void setStartupDir(const char * startupScript ) { size_t dirPathSize = findLastOccuranceOfDirectorySeparator(startupScript); char * temp = (char *) calloc(dirPathSize+2,sizeof(char)); strncpy(temp,startupScript,dirPathSize+1); temp[dirPathSize+1] = '\0'; baseDirectoryPath = (const char *) temp; }
static const char * createDirectoryQueryString(const char * fullFileName) { size_t dirPathSize = findLastOccuranceOfDirectorySeparator(fullFileName); char * temp = (char *) calloc(dirPathSize+3,sizeof(char)); strncpy(temp,fullFileName,dirPathSize); temp[dirPathSize] = '\\'; temp[dirPathSize+1] = '*'; temp[dirPathSize+2] = '\0'; return temp; }
static void setStartupDir(const char * startupScript ) { size_t dirPathSize = findLastOccuranceOfDirectorySeparator(startupScript); char * temp = (char *) calloc(max(dirPathSize+2,3),sizeof(char)); if ( dirPathSize ) { strncpy(temp,startupScript,dirPathSize+1); temp[dirPathSize+1] = '\0'; } else { strncpy(temp,".\\",2); temp [ 2 ] = '\0'; } baseDirectoryPath = (const char *) temp; }