Switch to unified view

a/upmpd/upmpdutils.cxx b/upmpd/upmpdutils.cxx
...
...
39
#include <sstream>
39
#include <sstream>
40
using namespace std;
40
using namespace std;
41
41
42
#include "mpdcli.hxx"
42
#include "mpdcli.hxx"
43
#include "upmpdutils.hxx"
43
#include "upmpdutils.hxx"
44
#include "libupnpp/log.hxx"
44
45
45
// Append system error string to input string
46
// Append system error string to input string
46
void catstrerror(string *reason, const char *what, int _errno)
47
void catstrerror(string *reason, const char *what, int _errno)
47
{
48
{
48
    if (!reason)
49
    if (!reason)
...
...
344
    char errbuf[ERRSIZE+1];
345
    char errbuf[ERRSIZE+1];
345
    regmatch_t pmatch[10];
346
    regmatch_t pmatch[10];
346
347
347
    if ((err = regcomp(&expr, sexp.c_str(), REG_EXTENDED))) {
348
    if ((err = regcomp(&expr, sexp.c_str(), REG_EXTENDED))) {
348
        regerror(err, &expr, errbuf, ERRSIZE);
349
        regerror(err, &expr, errbuf, ERRSIZE);
349
        cerr << "upmpd: regsub1: regcomp() failed: " << errbuf << endl;
350
        LOGERR("upmpd: regsub1: regcomp() failed: " << errbuf << endl);
350
        return string();
351
        return string();
351
    }
352
    }
352
    
353
    
353
    if ((err = regexec(&expr, input.c_str(), 10, pmatch, 0))) {
354
    if ((err = regexec(&expr, input.c_str(), 10, pmatch, 0))) {
354
        regerror(err, &expr, errbuf, ERRSIZE);
355
        regerror(err, &expr, errbuf, ERRSIZE);
355
        cerr << "upmpd: regsub1: regcomp() failed: " <<  errbuf << endl;
356
        //LOGDEB("upmpd: regsub1: regexec(" << sexp << ") failed: "
357
        //    <<  errbuf << endl);
356
        regfree(&expr);
358
        regfree(&expr);
357
        return string();
359
        return string();
358
    }
360
    }
359
    if (pmatch[0].rm_so == -1) {
361
    if (pmatch[0].rm_so == -1) {
360
        // No match
362
        // No match