diff options
| author | mrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-07-07 21:20:12 +0000 |
|---|---|---|
| committer | mrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-07-07 21:20:12 +0000 |
| commit | 1c8f43ad85f3a010768cd0f990c28e565d6f7a86 (patch) | |
| tree | 2600e20df607b3ea2c833813f4d80fc9fa1e6d7e /libjava/classpath/ltmain.sh | |
| parent | 49cde0f183d98789be0465af2fb89ee77fec563f (diff) | |
| download | ppe42-gcc-1c8f43ad85f3a010768cd0f990c28e565d6f7a86.tar.gz ppe42-gcc-1c8f43ad85f3a010768cd0f990c28e565d6f7a86.zip | |
Port to hosts whose 'sort' and 'tail' implementations
treat operands with leading '+' as file names, as POSIX
has required since 2001. However, make sure the code still
works on pre-POSIX hosts.
* libjava/classpath/ltmain.sh: Don't assume "sort +2" is
equivalent to "sort -k 3", since POSIX 1003.1-2001 no longer
requires this.
This uses the same fix that is already in
libjava/libltdl/ltmain.sh.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@115271 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath/ltmain.sh')
| -rw-r--r-- | libjava/classpath/ltmain.sh | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libjava/classpath/ltmain.sh b/libjava/classpath/ltmain.sh index 219823fc45d..a3c55f9a751 100644 --- a/libjava/classpath/ltmain.sh +++ b/libjava/classpath/ltmain.sh @@ -3839,7 +3839,13 @@ extern \"C\" { fi # Try sorting and uniquifying the output. - if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then + if grep -v "^: " < "$nlist" | + if sort -k 3 </dev/null >/dev/null 2>&1; then + sort -k 3 + else + sort +2 + fi | + uniq > "$nlist"S; then : else grep -v "^: " < "$nlist" > "$nlist"S |

