Ticket #611: quest-fix.patch

File quest-fix.patch, 842 bytes (added by Olly Betts, 12 years ago)

Attempt to fix this

  • examples/quest.cc

     
    6969    return strcmp(f1.s, f2.s) < 0;
    7070}
    7171
    72 inline bool operator<(const qp_flag & f, const char * s) {
    73     return strcmp(f.s, s) < 0;
    74 }
    75 
    76 inline bool operator<(const char * s, const qp_flag & f) {
    77     return strcmp(s, f.s) < 0;
    78 }
    79 
    8072static void show_usage() {
    8173    cout << "Usage: "PROG_NAME" [OPTIONS] 'QUERY'\n"
    8274"NB: QUERY should be quoted to protect it from the shell.\n\n"
     
    110102}
    111103
    112104static unsigned
    113 decode_qp_flag(const char * f)
     105decode_qp_flag(const char * s)
    114106{
     107    qp_flag f;
     108    f.s = s;
    115109    const qp_flag * p = lower_bound(flag_tab, flag_tab + n_flag_tab, f);
    116110    if (p == flag_tab + n_flag_tab || f < *p)
    117111        return 0;