Ticket #6597: 6597-datadirect-win32.2.patch

File 6597-datadirect-win32.2.patch, 2.3 KB (added by Jeff Lu <jll544@…>, 15 years ago)

Replaces previous DD patch; simplified to use QStrring.replace

  • libs/libmythtv/datadirect.cpp

     
    10111011        QMutexLocker locker(&user_agent_lock);
    10121012        command = QString(
    10131013            "wget --http-user='%1' --http-passwd='%2' --post-file='%3' "
    1014             "--header='Accept-Encoding:gzip' %4 "
    1015             "--user-agent='%5' --output-document=- ")
     1014            " %4 --user-agent='%5' --output-document=- ")
    10161015            .arg(userid).arg(password).arg(postFilename).arg(ddurl)
    10171016            .arg(user_agent);
    10181017    }
    10191018
     1019#ifdef USING_MINGW
     1020    // Unescape single-quotes in passwd, userid
     1021    command.replace("\\'","'");
     1022    // Allow for double quotes in userid and password (shell escape)
     1023    command.replace("\"","^\"");
     1024    // Replace remaining single quotes with double-quotes
     1025    command.replace("'", "\"");
     1026    // gzip on win32 complains about broken pipe, so don't use it
     1027#else
    10201028    // if (!SHOW_WGET_OUTPUT)
    10211029    //    command += " 2> /dev/null ";
    10221030
    1023     command += " | gzip -df";
     1031    command += " --header='Accept-Encoding:gzip' | gzip -df";
     1032#endif
    10241033
    10251034    if (SHOW_WGET_OUTPUT)
    10261035        VERBOSE(VB_GENERAL, "command: "<<command<<endl);
     
    10871096            .arg(GetUserID().replace('\'', "'\\''"))
    10881097            .arg(GetPassword().replace('\'', "'\\''")).arg(postFilename)
    10891098            .arg(ddurl).arg(user_agent).arg(resultFilename);
     1099#ifdef USING_MINGW
     1100            // Unescape single-quotes in passwd, userid
     1101            command.replace("\\'","'");
     1102            // Allow for double quotes in userid and password (shell escape)
     1103            command.replace("\"","^\"");
     1104            // Replace remaining single quotes with double-quotes
     1105            command.replace("'", "\"");
     1106#endif
    10901107    }
    10911108
    10921109    if (SHOW_WGET_OUTPUT)
    10931110        VERBOSE(VB_GENERAL, "command: "<<command<<endl);
     1111#ifndef USING_MINGW
    10941112    else
    10951113        command += " 2> /dev/null ";
     1114#endif
    10961115
    10971116    myth_system(command);
    10981117
     
    19922011    command += "--output-document=";
    19932012    command += (documentFile.isEmpty()) ? "- " : dfile;
    19942013
     2014#ifdef USING_MINGW
     2015    command.replace("'", "\"");
     2016#endif
     2017
    19952018    if (SHOW_WGET_OUTPUT)
    19962019        VERBOSE(VB_GENERAL, "command: "<<command<<endl);
    19972020    else