summaryrefslogtreecommitdiffstats
path: root/usr.bin/locate
diff options
context:
space:
mode:
authorwosch <wosch@FreeBSD.org>1996-10-27 19:04:27 +0000
committerwosch <wosch@FreeBSD.org>1996-10-27 19:04:27 +0000
commiteac0f49e25a3b01bc2d50d0677e503ea483d7794 (patch)
treeec0e933bb2cc2350f66fb48266cd014170c8247a /usr.bin/locate
parent14dde53c5585fb5bc7fc8d2b646502d9d474c306 (diff)
downloadFreeBSD-src-eac0f49e25a3b01bc2d50d0677e503ea483d7794.zip
FreeBSD-src-eac0f49e25a3b01bc2d50d0677e503ea483d7794.tar.gz
Do not store character 30. I made a test at my CS department
and at least one user use this char in a file name. Older locate implementions core'd.
Diffstat (limited to 'usr.bin/locate')
-rw-r--r--usr.bin/locate/code/locate.code.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/usr.bin/locate/code/locate.code.c b/usr.bin/locate/code/locate.code.c
index 67228da..c28119f 100644
--- a/usr.bin/locate/code/locate.code.c
+++ b/usr.bin/locate/code/locate.code.c
@@ -34,7 +34,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: locate.code.c,v 1.5 1996/08/31 14:51:18 wosch Exp $
+ * $Id: locate.code.c,v 1.6 1996/10/13 01:44:28 wosch Exp $
*/
#ifndef lint
@@ -176,6 +176,13 @@ main(argc, argv)
/* remove newline */
for (cp = path; *cp != '\0'; cp++) {
+#ifndef LOCATE_CHAR30
+ /* old locate implementations core'd for char 30 */
+ if (*cp == SWITCH)
+ *cp = '?';
+ else
+#endif /* !LOCATE_CHAR30 */
+
/* chop newline */
if (*cp == '\n')
*cp = '\0';
OpenPOWER on IntegriCloud