Comment 1 for bug 33485

Revision history for this message
Chris Moore (dooglus) wrote : patch to fix the problem

This fixes it by implcitly turning on "--fixed-string" and removing the $ if it appears at the end of the regexp with the --regexp flag in effect.

It does the same for \z and \Z too.

Examples of it working:

chris@chrislap:~$ /tmp/apt-file -x search '/usr/bin/firefox$'
firefox: usr/bin/firefox

chris@chrislap:~$ /tmp/apt-file -x search '/usr/bin/firefox\z'
firefox: usr/bin/firefox

chris@chrislap:~$ /tmp/apt-file -x search '/usr/bin/firefox\Z'
firefox: usr/bin/firefox

# find all programs in /usr/bin beginning with f and ending in x:

chris@chrislap:~$ /tmp/apt-file -x search '/usr/bin/f.*x$'
efax: usr/bin/fax
facturalux: usr/bin/facturalux
fcitx: usr/bin/fcitx
felix: usr/bin/flx
firedns: usr/bin/fdnsmx
firefox: usr/bin/firefox
flex: usr/bin/flex
flex-old: usr/bin/flex
fluxbox: usr/bin/fluxbox
fookb-plainx: usr/bin/fookb-plainx
freebsd5-buildutils: usr/bin/freebsd-lex
freebsd5-buildutils: usr/bin/freebsd-yyfix
ispell: usr/bin/findaffix
tetex-bin: usr/bin/fdf2tex
transfig: usr/bin/fig2ps2tex
vflib2: usr/bin/fwindex