• Tom Lane's avatar
    Rewrite tab completion's previous-word fetching for more sanity. · dce92c6d
    Tom Lane authored
    Make it return empty strings when there are no more words to the left of
    the current position, instead of sometimes returning NULL and other times
    returning copies of the leftmost word.  Also, fetch the words in one scan,
    rather than the previous wasteful approach of starting from scratch for
    each word.  Make the code a bit harder to break when someone decides we
    need more words of context, too.  (There was actually a memory leak here,
    because whoever added prev6_wd neglected to free it.)
    dce92c6d
tab-complete.c 112 KB