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

Last change on this file since 5 was 2, checked in by Dmitry A. Kuminov, 16 years ago

Initially imported qt-all-opensource-src-4.5.1 from Trolltech.

  • Property svn:executable set to *
File size: 426 bytes
Line 
1#!/bin/sh
2
3FILE="$1"
4RES="$FILE"
5
6if [ `echo $FILE | cut -b1` = "/" ]; then
7 true
8else
9 RES="$PWD/$FILE"
10 test -d "$RES" && RES="$RES/"
11 RES=`echo "$RES" | sed "s,/\(\./\)*,/,g"`
12
13# note: this will only strip 1 /path/../ from RES, i.e. given /a/b/c/../../../, it returns /a/b/../../
14 RES=`echo "$RES" | sed "s,\(/[^/]*/\)\.\./,/,g"`
15
16 RES=`echo "$RES" | sed "s,//,/,g" | sed "s,/$,,"`
17fi
18echo $RES #return
19
Note: See TracBrowser for help on using the repository browser.