       # HEURISTIC: check first if we just have a long "(.../file.tex" (or similar) line
       # A bit inefficient as we duplicate some of the code below for filename matching
       file_match = file_rx.exec(line)
+      if file_match
+        if line.startsWith('runsystem') or file_package_rx.exec(line)
+          debug("Ignoring possible file: #{line}")
+          file_match = false
+
       if file_match
         debug("MATCHED (long line)")
         file_name = file_match[1]

          # HEURISTIC: if extra line begins with "Package:" "File:" "Document Class:",
          # or other "well-known markers",
          # we just had a long file name, so do not add
          if extralen>0 && (extra.slice(0,5)=="File:" || extra.slice(0,8)=="Package:" || extra.slice(0,15)=="Document Class:") || (extra.slice(0,9)=="LaTeX2e <") || extra.match(assignment_rx)
            debug("Found File: and friends, or LaTeX2e, or assignment_rx match")
            extend_line = false
            # no need to recycle extra, as it's nothing we are interested in

      debug(line)

    # Skip things that are clearly not file names, though they may trigger false positives
    if line.length > 0 and (
      line.slice(0,5) == "File:" or
      line.slice(0,8) == "Package:" or
      line.slice(0,11) == "Dictionary:" or
      line.slice(0,15) == "Document Class:"
    ) or line.slice(0,9) == "LaTeX2e <" or line.match(assignment_rx)
      continue

    # Are we done? Get rid of extra spaces, just in case (we may have extended a line, etc.)
