1
0
Fork 0
mirror of https://gitlab.com/niansa/pilang2.git synced 2025-03-06 20:49:22 +01:00

Fixed SIGSEGV

This commit is contained in:
niansa 2020-04-13 15:38:26 +02:00
parent 6be4891dc8
commit 06cdb03992

View file

@ -459,19 +459,19 @@ std::string run_command(std::string command, std::vector<std::string> args) {
// Interpreter initialiser
void init_interpreter(int argc, char *argv[]) {
// Load modules from modules directory
struct dirent *dp;
DIR *dfd;
char filename_qfd[264];
char moduledir [] = "modules";
dfd = opendir(moduledir);
while ((dp = readdir(dfd)) != NULL) {
sprintf(filename_qfd , "%s/%s",moduledir,dp->d_name);
// Skip . and ..
if (strcmp(dp->d_name,"..") or strcmp(dp->d_name,"."))
continue;
// Load file
std::cout << "Module loading not yet implemented for: " << filename_qfd << std::endl;
}
//struct dirent *dp;
//DIR *dfd;
//char filename_qfd[264];
//char moduledir [] = "modules";
//dfd = opendir(moduledir);
//while ((dp = readdir(dfd)) != NULL) {
// sprintf(filename_qfd , "%s/%s",moduledir,dp->d_name);
// // Skip . and ..
// if (strcmp(dp->d_name,"..") or strcmp(dp->d_name,"."))
// continue;
// // Load file
// std::cout << "Module loading not yet implemented for: " << filename_qfd << std::endl;
//}
// Generate list of arguments
for (int elemnum = 0; elemnum < argc; elemnum++) {
cmdargs.push_back(std::string(argv[elemnum]));