Steve Wolter wrote:
Hello again,
> "file:///" + file.path
Excuse my earlier mail - the mistake seemed to be in a different place.
The uid generating function in the model.js file seems broken; for a
URL like file:///, it generates an empty uid.
I've fixed it. A diff is attached.
Faithfully yours, Steve
--
Almost anything derogatory you could say about today's software design
would be accurate.
-- K. E. Iverson
87c87
< {
---
> {
89,93d88
< var body;
< if( index > -1 )
< body = url.substring(index+3);
< else
< body = url;
95,98c90,104
< if( body.indexOf("/") != -1 )
< domain = body.split("/")[0];
< if( domain.indexOf(":") != -1 )
< domain = domain.split(":")[0]; // there are cases when port number follows domain name
---
> if (url.substring(0, index) != "file") {
> var body;
> if( index > -1 )
> body = url.substring(index+3);
> else
> body = url;
> if( body.indexOf("/") != -1 )
> domain = body.split("/")[0];
> if( domain.indexOf(":") != -1 )
> domain = domain.split(":")[0]; // there are cases when port number follows domain name
> } else {
> // There actually _has_ to be a "/" in there - because there is a "//"
> var filenamestart = url.lastIndexOf("/")+1;
> domain = url.substring(filenamestart);
> }
_______________________________________________
Newsfox mailing list
Newsfox@...
http://mozdev.org/mailman/listinfo/newsfox