[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash/server/asobj SharedObject.cpp
From: |
Rob Savoye |
Subject: |
[Gnash-commit] gnash/server/asobj SharedObject.cpp |
Date: |
Fri, 21 Dec 2007 02:57:25 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Rob Savoye <rsavoye> 07/12/21 02:57:25
Modified files:
server/asobj : SharedObject.cpp
Log message:
Correct typo.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/SharedObject.cpp?cvsroot=gnash&r1=1.19&r2=1.20
Patches:
Index: SharedObject.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/SharedObject.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- SharedObject.cpp 21 Dec 2007 02:15:19 -0000 1.19
+++ SharedObject.cpp 21 Dec 2007 02:57:25 -0000 1.20
@@ -226,10 +226,12 @@
static boost::intrusive_ptr<SharedObject> obj = new SharedObject();
string::size_type pos;
-
+ string rootdir;
if (fn.nargs > 0) {
- std::string filespec = fn.arg(0).to_string();
-
+ string filespec = fn.arg(0).to_string();
+ // If there is a second argument to getLocal(), it replaces
+ // the default path, which is the swf file name, with this
+ // supplied path.
// the object name appears to be the same as the file name, but
// minus the suffix.
if ((pos = filespec.find(".sol", 0) == string::npos)) {
@@ -266,6 +268,15 @@
newspec += domain;
newspec += "/";
+ if (fn.nargs == 2) {
+ rootdir = fn.arg(1).to_string();
+// log_msg("The root dir is now %s", rootdir.c_str());
+ newspec += rootdir;
+ } else {
+ log_debug("If I had my swf filename. I'd be writing it to the .sol
file path");
+ }
+ newspec += "/";
+
if (obj->getFilespec().find("/", 0) != string::npos) {
typedef tokenizer<char_separator<char> > Tok;
char_separator<char> sep("/");
@@ -275,9 +286,10 @@
for(tit=t.begin(); tit!=t.end();++tit){
cout << *tit << "\n";
newdir += *tit;
- if (newdir.find("..", 0 != string::npos)) {
+ if (newdir.find("..", 0) != string::npos) {
return as_value(false);
}
+ // Don't try to create a directory of the .sol file name!
if (newdir.rfind(".sol", newdir.size()) == string::npos) {
int ret = mkdir(newdir.c_str(), S_IRUSR|S_IWUSR|S_IXUSR);
if ((errno != EEXIST) && (ret != 0)) {