W3C home > Mailing lists > Public > public-html-commits@w3.org > June 2011

html5/spec Overview.html,1.4992,1.4993

From: Ian Hickson via cvs-syncmail <cvsmail@w3.org>
Date: Wed, 15 Jun 2011 04:32:57 +0000
To: public-html-commits@w3.org
Message-Id: <E1QWhmj-0002k6-RL@lionel-hutz.w3.org>
Update of /sources/public/html5/spec
In directory hutz:/tmp/cvs-serv10528

Modified Files:
	Overview.html 
Log Message:
it was pointed out that Unix paths can contain backslashes (whatwg r6229)

Index: Overview.html
===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.4992
retrieving revision 1.4993
diff -u -d -r1.4992 -r1.4993
--- Overview.html	15 Jun 2011 00:02:04 -0000	1.4992
+++ Overview.html	15 Jun 2011 04:32:53 -0000	1.4993
@@ -34901,13 +34901,16 @@
    following function extracts the filename in a suitably compatible
    manner:</p>
 
-   <pre>function extractFilename(path) {  var x;
-  x = path.lastIndexOf('\\');
-  if (x &gt;= 0) // Windows-based path
-    return path.substr(x+1);
+   <pre>function extractFilename(path) {
+  if (path.substr(0, 12) == "C:\\fakepath\\")
+    return path.substr(12); // modern browser
+  var x;
   x = path.lastIndexOf('/');
   if (x &gt;= 0) // Unix-based path
     return path.substr(x+1);
+  x = path.lastIndexOf('\\');
+  if (x &gt;= 0) // Windows-based path
+    return path.substr(x+1);
   return path; // just the filename
 }</pre>
 
Received on Wednesday, 15 June 2011 04:32:59 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 15 June 2011 04:33:01 GMT