From 6e205265693c824a6f6b43176f27b16f9ec1c749 Mon Sep 17 00:00:00 2001 From: Trevor Drake Date: Wed, 8 Jul 2015 22:33:24 +0100 Subject: [PATCH] Teach atree about absolute path and fix misleading error message sdk build was failing when OUT_DIR_COMMON_BASE is an absolute path Change-Id: Ie84b94a4de19a837a93d4a8338d4ef23f9a5ee4e --- tools/atree/files.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/atree/files.cpp b/tools/atree/files.cpp index b90f8b3d28..7ec5589112 100644 --- a/tools/atree/files.cpp +++ b/tools/atree/files.cpp @@ -339,11 +339,15 @@ locate(FileRecord* rec, const vector& search) } int err; - + string full; for (vector::const_iterator it=search.begin(); it!=search.end(); it++) { - string full = path_append(*it, rec->sourceName); struct stat st; + if (rec->sourceName.length() != 0 && rec->sourceName[0] == '/') + full = rec->sourceName; + else + full = path_append(*it, rec->sourceName); + err = stat(full.c_str(), &st); if (err == 0) { rec->sourceBase = *it; @@ -356,7 +360,7 @@ locate(FileRecord* rec, const vector& search) } fprintf(stderr, "%s:%d: couldn't locate source file: %s\n", - rec->listFile.c_str(), rec->listLine, rec->sourceName.c_str()); + rec->listFile.c_str(), rec->listLine, full.c_str()); return 1; }