--- a/global/global.c 2017-03-02 23:30:18.632268436 +0100 +++ b/global/global.c 2017-03-02 22:59:17.867998651 +0100 @@ -841,6 +841,23 @@ if (isregex(av)) die_with_code(2, "regular expression is not allowed with the --from-here option."); db = decide_tag_by_context(av, context_file, atoi(context_lineno)); + /* + * If we are in case-insensitive mode and have not found + * anything yet, we try to find a matching definition and + * try again. + */ + if (iflag && db == GSYMS) { + GTOP *gtop = gtags_open(dbpath, root, GTAGS, GTAGS_READ, 0); + GTP *gtp; + char edit[IDENTLEN]; + + snprintf(edit, sizeof(edit), "^%s$", av); + gtp = gtags_first(gtop, edit, GTOP_KEY | GTOP_BASICREGEX | GTOP_IGNORECASE); + gtags_close(gtop); + if (gtp) { + db = decide_tag_by_context(gtp->tag, context_file, atoi(context_lineno)); + } + } } else { if (dflag) db = GTAGS;