[comp.bugs.misc] Mkmf

john@uw-nsr.UUCP (John Sambrook) (01/03/88)

I've been using mkmf(1) for more than a year and only recently
found this bug, so it's not likely to have affected many people.
However, the fix is dead easy.  BTW, mkmf(1) is a great tool; if
you don't have it you should consider getting it.

The problem is in the function lookupinclude() in file depend.c.
If you run mkmf(1) in a directory containing assembler sources
the variable "includetable" is never initialized.  A few lines
later htlookup() may be called with this garbage value, causing
a traceback.

Here is a context diff of the fix I chose to make:

*** depend.c.old	Sat Jan  2 10:42:22 1988
--- depend.c.new	Sat Jan  2 10:41:37 1988
***************
*** 373,378
  		case INCLUDE_PASCAL:
  			includetable = P_INCLUDETABLE;
  			break;
  		}
  	return((includetable == NULL) ? NULL : htlookup(incname, includetable));
  }

--- 373,381 -----
  		case INCLUDE_PASCAL:
  			includetable = P_INCLUDETABLE;
  			break;
+                 default:
+                         includetable = NULL;
+                         break;
  		}
  	return((includetable == NULL) ? NULL : htlookup(incname, includetable));
  }


-- 
John Sambrook                        Internet: john@nsr.bioeng.washington.edu
University of Washington RC-05           UUCP: uw-nsr!john
Seattle, Washington  98195               Dial: (206) 548-4386