mirror of
https://gitlab.com/niansa/pilang2.git
synced 2025-03-06 20:49:22 +01:00
Fixed SIGSEGV
This commit is contained in:
parent
6be4891dc8
commit
06cdb03992
1 changed files with 13 additions and 13 deletions
26
main.cpp
26
main.cpp
|
@ -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]));
|
||||
|
|
Loading…
Add table
Reference in a new issue