Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit de3ab0a9 authored by Chris Warrington's avatar Chris Warrington
Browse files

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
parent b2ba6dfc
Loading
Loading
Loading
Loading
+10 −15
Original line number Diff line number Diff line
@@ -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;
            }