Ticket #611: quest-fix.patch
File quest-fix.patch, 842 bytes (added by , 12 years ago) |
---|
-
examples/quest.cc
69 69 return strcmp(f1.s, f2.s) < 0; 70 70 } 71 71 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 80 72 static void show_usage() { 81 73 cout << "Usage: "PROG_NAME" [OPTIONS] 'QUERY'\n" 82 74 "NB: QUERY should be quoted to protect it from the shell.\n\n" … … 110 102 } 111 103 112 104 static unsigned 113 decode_qp_flag(const char * f)105 decode_qp_flag(const char * s) 114 106 { 107 qp_flag f; 108 f.s = s; 115 109 const qp_flag * p = lower_bound(flag_tab, flag_tab + n_flag_tab, f); 116 110 if (p == flag_tab + n_flag_tab || f < *p) 117 111 return 0;