From 509433edf704644190bc6715adcb1272a1955da3 Mon Sep 17 00:00:00 2001
From: Andrew Hsieh <andrewhsieh@google.com>
Date: Wed, 2 May 2012 12:14:34 +0800
Subject: Fixed emulator fails to load lib*GL when launched from its own
 directory

When emulator is lunched from its own directory (ie. cd out/*/bin; ./emulator),
emulator fails to locate shared libraries lib*GL at out/*/lib because utility
function path_parent(".", 1) incorrectly returns NULL instead of "..".
Fixed that case.

Change-Id: I86f8e5d655107ae8cd2237d59518180ce6e69c53
---
 android/utils/path.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/android/utils/path.c b/android/utils/path.c
index 1bcdc4e..3e9d97b 100644
--- a/android/utils/path.c
+++ b/android/utils/path.c
@@ -78,8 +78,12 @@ path_parent( const char*  path, int  levels )
         while (base > path && !ispathsep(base[-1]))
             base--;
 
-        if (base <= path) /* we can't go that far */
+        if (base <= path) {
+            if (end == base+1 && base[0] == '.' && levels == 1)
+                return strdup("..");
+          /* we can't go that far */
             return NULL;
+        }
 
         if (end == base+1 && base[0] == '.')
             goto Next;
-- 
cgit v1.1