Complete finite automaton to never fail a match but either match original or up until the orginal
Here is what I came up with finally. I need the following operations on  finite automata, for automata a and b.


allPrefixes(a) creates an automaton that matches all non-empty prefixes of the language L(a). The implementation is quite simple on a DFA. Make sure there are no useless states (those with no path to a stop state). Then make all states except the start state into stop states.
invert(a) creates an automaton that matches the complement of L(a).
asSubstring(a) creates an automaton that matches every string in $\Sigma^*$L(a)$\Sigma^*$.
not(a) is a shortcut for invert(asSubstring(a)).
or(a,b) is the automaton that recognizes L(a)$\cup$L(b).


Given an automaton a, the automaton which comes very close to what I was after is then easy to describe as c=or(a, not(allPrefixes(a)).

Remember that I want filtering, i.e. find a match, remove the matching input, find a match again and so on until end of input. The automaton c either matches my original a or all kinds of stuff that does not end in any prefix recognized by a. Except for a suffix of the input matching only a prefix of a, there will always be a prefix of the input being matched by c.