From: dtrg Date: Sun, 30 Jul 2006 23:38:41 +0000 (+0000) Subject: Adjusted to only check the module name against the leaf of the filename, to prevent... X-Git-Tag: release-6-0-pre-1~49 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=d3b557e0db14db1dfa6a98b570b660b8b7ea1cbf;p=ack.git Adjusted to only check the module name against the leaf of the filename, to prevent unnecessary warnings if the source file isn't in the current directory. --- diff --git a/lang/m2/comp/program.g b/lang/m2/comp/program.g index abc75bd35..05fedef61 100644 --- a/lang/m2/comp/program.g +++ b/lang/m2/comp/program.g @@ -236,10 +236,15 @@ ProgramModule { if (state == IMPLEMENTATION) { int len = strlen(dot.TOK_IDF->id_text); + char* leafname = strrchr(FileName, '/'); + if (leafname) + leafname++; + else + leafname = FileName; if (len > 10) len = 10; - if (strncmp(FileName, dot.TOK_IDF->id_text, len)) { - warning(W_ORDINARY, "modulename %s does not match filename %s", dot.TOK_IDF->id_text, FileName); + if (strncmp(leafname, dot.TOK_IDF->id_text, len)) { + warning(W_ORDINARY, "modulename %s does not match filename %s", dot.TOK_IDF->id_text, leafname); } df = GetDefinitionModule(dot.TOK_IDF, 0); CurrVis = df->mod_vis;