diff --git a/node_modules/c9/urls.js b/node_modules/c9/urls.js index 0ce9c60e..240931ff 100644 --- a/node_modules/c9/urls.js +++ b/node_modules/c9/urls.js @@ -94,7 +94,7 @@ function getBaseUrl(req, sourceBaseUrlPattern, targetBaseUrlPattern) { targetHost = "c9.io"; } - if (/^(ide|vfs)./.test(targetHost)) + if (/^(ide|vfs)\./.test(targetHost)) console.trace("Warning: possibly incorrect baseUrl constructed, with 'ide.' in the hostname: " + targetHost); return replaceDomain(targetBaseUrlPattern, targetHost) diff --git a/package.json b/package.json index 81aced1c..8337c3a7 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "c9", "description": "New Cloud9 Client", - "version": "3.1.1100", + "version": "3.1.1107", "author": "Ajax.org B.V. ", "private": true, "main": "bin/c9", @@ -81,7 +81,7 @@ "c9.ide.ace.split": "#0ae0151c78", "c9.ide.ace.statusbar": "#3aab0b67e0", "c9.ide.ace.stripws": "#cf0f42ac59", - "c9.ide.behaviors": "#5ae88f87e1", + "c9.ide.behaviors": "#db32109ebc", "c9.ide.closeconfirmation": "#cee4674141", "c9.ide.configuration": "#a9066299a2", "c9.ide.dialog.wizard": "#7667ec79a8", @@ -96,7 +96,7 @@ "c9.ide.mount": "#f46dc6dcd2", "c9.ide.navigate": "#38ae100ea1", "c9.ide.newresource": "#981a408a7b", - "c9.ide.openfiles": "#7fa4a97fed", + "c9.ide.openfiles": "#358ac94915", "c9.ide.preview": "#8f87ff2f6a", "c9.ide.preview.browser": "#c5b9a129de", "c9.ide.preview.markdown": "#bc846e1562", diff --git a/plugins/c9.fs/fs.cache.xml.js b/plugins/c9.fs/fs.cache.xml.js index 9d0babbe..da06cc24 100644 --- a/plugins/c9.fs/fs.cache.xml.js +++ b/plugins/c9.fs/fs.cache.xml.js @@ -216,7 +216,7 @@ define(function(require, exports, module) { : (linkInfo ? { link: true, linkStat: { fullPath: linkInfo } } : {}); - stat.mtime = Math.floor(Date.now() / 1000); + stat.mtime = Date.now(); node = createNode(e.path, stat); emit("add", {path : e.path, node : node}); @@ -464,15 +464,30 @@ define(function(require, exports, module) { var parts = path.split("/"); var node = context || model.root; if (!node) { - node = orphans[parts[0]]; //model.realRoot || + node = orphans[parts[0]]; // model.realRoot || if (node) parts.shift(); } if (path == "/") parts.shift(); + var up = 0; + for (var i = parts.length; i--;) { + var p = parts[i]; + if (!p && i || p === ".") { + parts.splice(i, 1); + } + else if (p === "..") { + parts.splice(i, 1); + up++; + } + else if (up) { + parts.splice(i, 1); + up--; + } + } + for (var i = 0; i < parts.length; i++) { var p = parts[i]; - if (!p && i) continue; // allow paths with trailing / if (node) node = node.map && node.map[p]; if (!node) @@ -579,6 +594,14 @@ define(function(require, exports, module) { node.children = null; + if (typeof node.mtime !== "number" && node.mtime) { + // why Date ends up here? + reportError(new Error("Date in fs cache"), { + stat: stat, + mtime: node.mtime, + path: node.path + }); + } if (!updating) { if (!modified.length) modified.push(parent); @@ -629,14 +652,6 @@ define(function(require, exports, module) { }); } else if (key === "children" || key === "isSelected") { prop = null; - } else if (Object.prototype.toString.call(node[key]) == "[object Date]") { - // why Date ends up here? - reportError(new Error("Date in fs cache"), { - key: key, - value: node[key], - path: node.path, - hasParentProp: !!node.parent, - }); } else { prop = lang.deepCopy(node[key]); } diff --git a/plugins/c9.fs/fs.js b/plugins/c9.fs/fs.js index 04e2d42d..f07b7746 100644 --- a/plugins/c9.fs/fs.js +++ b/plugins/c9.fs/fs.js @@ -21,6 +21,7 @@ define(function(require, exports, module) { var stream = require("./fs.streams")(vfs, options.base, options.baseProc, options.cli); var xhr = options.cli ? stream : require("./fs.xhr")(vfs.rest); var uCaseFirst = require("c9/string").uCaseFirst; + var normalize = require("path").normalize; var api = { readFile: xhr.readFile, @@ -65,6 +66,11 @@ define(function(require, exports, module) { if (typeof args[args.length - 1] != "function") throw new Error("Missing callback for " + name); + path = args[0] = normalize(path); + if (name == "rename" || name == "copy" || name == "symlink") { + args[1] = normalize(args[1]); + } + // // TODO disabled to not break local version on windows // if (!/^[!~/]/.test(path)) { // var e = new Error("Invalid path passed to fs " + name);