From e52b4cddebcbcfaebb047d0bd4a2af48ba43e304 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 31 Aug 2011 09:40:14 -0700 Subject: [PATCH] Bug 682166 - Allow absolute pathnames in js console read(). r=cdleary --- js/src/shell/js.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp index f038a7c3d580..1aafc0dd4144 100644 --- a/js/src/shell/js.cpp +++ b/js/src/shell/js.cpp @@ -3808,6 +3808,11 @@ MakeAbsolutePathname(JSContext *cx, const char *from, const char *leaf) char *dir; const char *slash = NULL, *cp; + if (*leaf == '/') { + /* We were given an absolute pathname. */ + return JS_strdup(cx, leaf); + } + cp = from; while (*cp) { if (*cp == '/') {