HylaFAX The world's most advanced open source fax server

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Solution: /usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.../../../sparc-sun-solaris2.7/include/assert.h



Re sed script to simplify:
`/usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.1/../../../../sparc-sun-solaris2.7/include/assert.h'

In November, I thought I would give something that worked, than all the
``sad'' people who delight in the inner wroking of sed would cut my script
apart and the correct answer would appear though collaboration.

So although my code worked it had flaws, but alas no word from the sed gurus.
Now I am depressed to discover I am becoming one of these said sad sed sadists.

So please allow me to offer this:

old line 252 and 253 in ``port/mkdepend.in'':
	-e :loop -e 's:[^\./][^\./]*/\.\./::g' -e tloop \
	-e 's:\([/ ]\)\./:\1:g' \
new:
	-e s:///*:/:g -e 's:^: :' -e 's: \([^/ ]\): ./\1:g' \
	-e :a -e 's:/\./:/:' -e 's:/\.\./://:' -e ta \
	-e :b -e 's:/[^/ ][^/ ]*//:/:' -e tb \
	-e :c -e s://:/../: -e tc \
	-e 's: \./\([^ ]\): \1:g' -e 's:^ ::' \

The prevoius was flawed IF the file name contained '^' in the
directory before the ``..'' or the first directory begins with '^' and
the second is ``..'' and then ONLY because no reduction took place.
[Yes me over here, that's my hand in the air, my fault ...]


James Lee
jameswlee@lineone.net


PS has anyone a more interesting problem?




Project hosted by iFAX Solutions