+
+ if(pkgname == "*") // =========================================== load all boxes (e.g. std/boxes/*)
+ {
+ int nbBssFiles;
+
+ if (upath[0]=='/' || upath[1] == ':' ) // ==== absolute name, load all .bbs files
+ {
+ int nbFiles = Utilities::Explore(upath, false, Filenames);
+ nbBssFiles = 0;
+ for (std::vector<std::string>::iterator i = Filenames.begin(); i!= Filenames.end(); ++i)
+ {
+ if ((*i).substr((*i).size()-4, 4) != ".bbs")
+ continue; // ignore non .bbs files
+ LoadScript(*i,name);
+ nbBssFiles++;
+ }
+ if (nbBssFiles==0)
+ bbtkMessage("Interpreter",2,
+ "WARNING : No '.bbs' file found in ["
+ << upath << "]" << std::endl);
+ return;
+ }
+
+ std::string path;
+ std::vector<std::string>::iterator i;
+ std::string fullDirectoryName;
+ for (i=script_paths.begin();i!=script_paths.end();++i)// ==== relative name, iterate + load all .bbs files
+ {
+ path = *i;
+
+ // we *really* want '.' to be the current working directory
+ if (path == ".") {
+ char buf[2048]; // for getcwd
+ char * currentDir = getcwd(buf, 2048);
+ std::string cwd(currentDir);
+ path = currentDir;
+ }
+
+ fullDirectoryName = Utilities::MakePkgnameFromPath(path, upath, false);
+
+ // Check if library exists
+ if ( ! Utilities::IsDirectory(fullDirectoryName) )
+ {
+ // The following is *NOT* a debug time message :
+ // It's a user intended message.
+ // Please don't remove it.
+ bbtkMessage("Interpreter",1," [" <<fullDirectoryName
+ <<"] : doesn't exist" <<std::endl);
+ continue; // try next path
+ }
+ foundFile = true;
+
+
+ int nbFiles = Utilities::Explore(fullDirectoryName, false, Filenames);
+
+ nbBssFiles = 0;
+ for (std::vector<std::string>::iterator i = Filenames.begin(); i!= Filenames.end(); ++i)
+ {
+
+ if ((*i).substr((*i).size()-4, 4) != ".bbs")
+ continue; // ignore non .bbs files
+ LoadScript(*i,name);
+ nbBssFiles++;
+ }
+ if (nbBssFiles==0)
+ bbtkMessage("Interpreter",1,
+ "WARNING : No '.bbs' file found in ["
+ << fullDirectoryName << "]" << std::endl);
+
+ //break; // a directory was found; we stop iterating
+ // LG : No! We want all files included !
+ }
+ return;
+ }
+
+ //std::string::size_type slash_position = name.find_last_of("/\\");
+
+ // if name starts with a / or a . or contains : user is assumed to have passed a relative/absolute name
+ // (not only a plain script name)
+ // we trust him, and try to expland the directory name
+ // WARNING : starting from current local directory : ./whatYouWant (./ mandatory!)
+
+ if (name[0]=='/' || name[1] == ':' || name[0]=='.') // absolute path (linux/windows) or relative path
+ {
+
+ // ===========================================================check user supplied location