source: trunk/config.tests/unix/makeabs@ 1030

Last change on this file since 1030 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
Line 
1#!/bin/sh
2
3FILE="$1"
4RES="$FILE"
5
6CUT_ARG="-b1"
7if [ `uname -s` = "QNX" ]; then
8 # QNX does not understand "-b1"
9 CUT_ARG="-c1"
10fi
11
12if [ `echo $FILE | cut $CUT_ARG` = "/" ]; then
13 true
14else
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,/$,,"`
23fi
24echo $RES #return
25
Note: See TracBrowser for help on using the repository browser.