httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@engelschall.com (Ralf S. Engelschall)
Subject Re: cvs commit: apache-1.3 STATUS
Date Fri, 20 Mar 1998 07:19:22 GMT

In article <19980319225410.59308@deejai.mch.sni.de> you wrote:
> On Tue, Mar 17, 1998 at 05:07:22PM +0100, Ralf S. Engelschall wrote:
>> 
>> <grins> Take this:
>> 
>> =============
>> #!/bin/sh
>> ##
>> ##  fp2rp -- convert a standard forward path to a reverse dotted path
>> ##           (used by ../Configure script)
>> ##
>> if [ "x$1" = x. ]; then
>>     rp="."
>> else
>>     rp=""
>>     for pe in `echo $1 | sed -e 's:/: :'`; do
>>         rp="../$rp"
>>     done
>> fi
>> echo $rp | sed -e 's:/$::'
>> =============

> Is that really
>     for pe in `echo $1 | sed -e 's:/: :'`
> and not
> 	      `echo $1 | sed -e 's:/: :g'`
> ? The former converts only the first occurrence?!

Ups, that a bug, but one which never occurs because
our subdir are only max. 2 dirs deep ;_), so it never
caused problems. But I'll fix it for the future to
avoid problems. Thanks.

> If the latter was intended, you can make it way faster by using
>     for pe in `IFS="$IFS/"; echo $1`; do

Sounds good, but why IFS="$IFS/"? I think IFS=/ is enough here, isn't it?

                                       Ralf S. Engelschall
                                       rse@engelschall.com
                                       www.engelschall.com

Mime
View raw message