Within the database, file names are terminated with a null character. This is the case for both the old and the new format.
When the new database format is being used, the compression technique
used to generate the database though relies on the ability to sort the
list of files before they are presented to
If the system’s sort command allows separating its input list of
files with null characters via the ‘-z’ option, this option
is used and therefore
locate will both
correctly handle file names containing newlines. If the
command lacks support for this, the list of files is delimited with
the newline character, meaning that parts of file names containing
newlines will be incorrectly sorted. This can result in both
incorrect matches and incorrect failures to match.