Last change
on this file since 987 was 561, checked in by Dmitry A. Kuminov, 15 years ago |
trunk: Merged in qt 4.6.1 sources.
|
-
Property svn:executable
set to
*
|
File size:
535 bytes
|
Rev | Line | |
---|
[2] | 1 | #!/bin/sh
|
---|
| 2 |
|
---|
| 3 | FILE="$1"
|
---|
| 4 | RES="$FILE"
|
---|
| 5 |
|
---|
[561] | 6 | CUT_ARG="-b1"
|
---|
| 7 | if [ `uname -s` = "QNX" ]; then
|
---|
| 8 | # QNX does not understand "-b1"
|
---|
| 9 | CUT_ARG="-c1"
|
---|
| 10 | fi
|
---|
| 11 |
|
---|
| 12 | if [ `echo $FILE | cut $CUT_ARG` = "/" ]; then
|
---|
[2] | 13 | true
|
---|
| 14 | else
|
---|
| 15 | RES="$PWD/$FILE"
|
---|
| 16 | test -d "$RES" && RES="$RES/"
|
---|
| 17 | RES=`echo "$RES" | sed "s,/\(\./\)*,/,g"`
|
---|
| 18 |
|
---|
| 19 | # note: this will only strip 1 /path/../ from RES, i.e. given /a/b/c/../../../, it returns /a/b/../../
|
---|
| 20 | RES=`echo "$RES" | sed "s,\(/[^/]*/\)\.\./,/,g"`
|
---|
| 21 |
|
---|
| 22 | RES=`echo "$RES" | sed "s,//,/,g" | sed "s,/$,,"`
|
---|
| 23 | fi
|
---|
| 24 | echo $RES #return
|
---|
| 25 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.