diff options
author | Chris Warrington <cmw@google.com> | 2015-02-10 20:14:44 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2015-02-10 20:14:44 +0000 |
commit | 4308c2aea45a4780b460734ee8634d74205c15c5 (patch) | |
tree | 498f4cb77b8ec300600636ef72693736b9468cdd /tools/aapt | |
parent | c6ec79913fbcf5b915ed55f3cc7b49690ee997f9 (diff) | |
parent | 449988872be61f273c91db13069d5b7172429032 (diff) | |
download | frameworks_base-4308c2aea45a4780b460734ee8634d74205c15c5.zip frameworks_base-4308c2aea45a4780b460734ee8634d74205c15c5.tar.gz frameworks_base-4308c2aea45a4780b460734ee8634d74205c15c5.tar.bz2 |
am 510c24e8: Merge "Fix AAPT daemon mode with paths containg spaces." into lmp-mr1-dev
automerge: 4499888
* commit '449988872be61f273c91db13069d5b7172429032':
Fix AAPT daemon mode with paths containg spaces.
Diffstat (limited to 'tools/aapt')
-rw-r--r-- | tools/aapt/Command.cpp | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/tools/aapt/Command.cpp b/tools/aapt/Command.cpp index f4581d0..8a0a39c 100644 --- a/tools/aapt/Command.cpp +++ b/tools/aapt/Command.cpp @@ -2531,22 +2531,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; } |