Project

General

Profile

Bug #6972

GNU egrep script doesn't correctly quote $0

Added by Georg Nikodym over 3 years ago. Updated over 3 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
2016-05-13
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

My use case is a test rig with a contrived path with spaces to catch quoting problems.

PATH=/testing/constrained toolset

The "constrained toolset" directory is filled with symlinks to the limited set of
external programs that we're willing to allow bitkeeper to call out to.

I offer this patch:

--- egrep-old 2016-05-13 08:48:38.672564991 -0700
+++ egrep 2016-05-13 08:50:07.222135259 -0700
@ -1,8 +1,8 @
#!/bin/sh

-REALPATH=`realpath $0`
-DIRNAME=`dirname $REALPATH`
-BASENAME=`basename $0`
+REALPATH=`realpath "$0"`
+DIRNAME=`dirname "$REALPATH"`
+BASENAME=`basename "$0"`

case $BASENAME in
egrep)

History

#1

Updated by Alexander Pyhalov over 3 years ago

Please, create pull request against https://github.com/OpenIndiana/oi-userland/ . Don't forget to add REQUIRED_PACKAGES to ggrep Makefile and bump COMPONENT_REVISION.

#2

Updated by Georg Nikodym over 3 years ago

Sigh. You are assuming that I know what you're talking about...

I'll eventually figure it out but it will take time...

Be ready for n00b questions.

#3

Updated by Georg Nikodym over 3 years ago

Pull request created (#2004).

#4

Updated by Alexander Pyhalov over 3 years ago

  • Status changed from New to Resolved

Also available in: Atom PDF