Skip to content

Instantly share code, notes, and snippets.

@boucher
Created February 3, 2010 23:50
Show Gist options
  • Save boucher/294191 to your computer and use it in GitHub Desktop.
Save boucher/294191 to your computer and use it in GitHub Desktop.
diff --git a/Objective-J/CFBundle.js b/Objective-J/CFBundle.js
index 0eaec77..cd4bb71 100644
--- a/Objective-J/CFBundle.js
+++ b/Objective-J/CFBundle.js
@@ -41,7 +41,7 @@ CFBundle.bundleContainingPath = function(/*String*/ aPath)
while (aPath !== "/")
{
var bundle = CFBundlesForPaths[aPath];
-
+
if (bundle)
return bundle;
diff --git a/Objective-J/StaticResourceNode.js b/Objective-J/StaticResourceNode.js
index 66c42f0..5507314 100644
--- a/Objective-J/StaticResourceNode.js
+++ b/Objective-J/StaticResourceNode.js
@@ -76,12 +76,11 @@ require("file");
dirname: function(/*String*/ aPath)
{
- var aPath = FILE.normal(aPath);
+ var aPath = FILE.normal(aPath),
+ components = FILE.split(aPath);
- if (aPath === "/")
- return aPath;
-
- var components = FILE.split(aPath);
+ if (components.length === 2)
+ components.unshift("");
return FILE.join.apply(FILE, components.slice(0, components.length - 1));
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment