summaryrefslogtreecommitdiffstats
path: root/tools/aapt/Command.cpp
diff options
context:
space:
mode:
authorChris Warrington <cmw@google.com>2015-02-09 21:04:46 -0800
committerChris Warrington <cmw@google.com>2015-02-09 21:20:52 -0800
commitde3ab0a9e8609f6a631b2c047f352069bb9cfa86 (patch)
tree38f6f86f25ece3125b0dbece7b39957dc2fc82a2 /tools/aapt/Command.cpp
parentb2ba6dfc7b33ec9e58d9f556206440a26069e264 (diff)
downloadframeworks_base-de3ab0a9e8609f6a631b2c047f352069bb9cfa86.zip
frameworks_base-de3ab0a9e8609f6a631b2c047f352069bb9cfa86.tar.gz
frameworks_base-de3ab0a9e8609f6a631b2c047f352069bb9cfa86.tar.bz2
Fix AAPT daemon mode with paths containg spaces.
Use new line as a delimiter rather than space. Fixes: https://code.google.com/p/android/issues/detail?id=135757 Gradle CL: https://android-review.googlesource.com/130423 Change-Id: I7c73e680b0417b0e7cff9e0110822675c53ae20f
Diffstat (limited to 'tools/aapt/Command.cpp')
-rw-r--r--tools/aapt/Command.cpp25
1 files changed, 10 insertions, 15 deletions
diff --git a/tools/aapt/Command.cpp b/tools/aapt/Command.cpp
index d23b82e..3fa131e 100644
--- a/tools/aapt/Command.cpp
+++ b/tools/aapt/Command.cpp
@@ -2533,22 +2533,17 @@ int doSingleCrunch(Bundle* bundle)
int runInDaemonMode(Bundle* bundle) {
std::cout << "Ready" << std::endl;
- for (std::string line; std::getline(std::cin, line);) {
- if (line == "quit") {
+ for (std::string cmd; std::getline(std::cin, cmd);) {
+ if (cmd == "quit") {
return NO_ERROR;
- }
- std::stringstream ss;
- ss << line;
- std::string s;
-
- std::string command, parameterOne, parameterTwo;
- std::getline(ss, command, ' ');
- std::getline(ss, parameterOne, ' ');
- std::getline(ss, parameterTwo, ' ');
- if (command[0] == 's') {
- bundle->setSingleCrunchInputFile(parameterOne.c_str());
- bundle->setSingleCrunchOutputFile(parameterTwo.c_str());
- std::cout << "Crunching " << parameterOne << std::endl;
+ } else if (cmd == "s") {
+ // Two argument crunch
+ std::string inputFile, outputFile;
+ std::getline(std::cin, inputFile);
+ std::getline(std::cin, outputFile);
+ bundle->setSingleCrunchInputFile(inputFile.c_str());
+ bundle->setSingleCrunchOutputFile(outputFile.c_str());
+ std::cout << "Crunching " << inputFile << std::endl;
if (doSingleCrunch(bundle) != NO_ERROR) {
std::cout << "Error" << std::endl;
}