diff options
author | Zoltan Arvai <zarvai@inf.u-szeged.hu> | 2014-03-27 17:27:22 +0100 |
---|---|---|
committer | Zoltan Arvai <zarvai@inf.u-szeged.hu> | 2014-03-28 18:46:12 +0100 |
commit | a6014652040e76de08e643b49b69fc97cb5bfd62 (patch) | |
tree | 756e51a1a5fc717e2a15a84aca686eb7fd43ff7d /chromium/third_party/cygwin/lib/perl5/5.10/getcwd.pl | |
parent | d12a5818c08a6e4ca207a0bb1688cb4d82c20460 (diff) | |
download | qtwebengine-chromium-a6014652040e76de08e643b49b69fc97cb5bfd62.tar.gz |
Add perl to cygwin
On Windows third_party/WebKit build depends on cygwin's perl version.
Change-Id: Icf6393906c0f977fca9ff652a8abca9dacb60765
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Diffstat (limited to 'chromium/third_party/cygwin/lib/perl5/5.10/getcwd.pl')
-rw-r--r-- | chromium/third_party/cygwin/lib/perl5/5.10/getcwd.pl | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/chromium/third_party/cygwin/lib/perl5/5.10/getcwd.pl b/chromium/third_party/cygwin/lib/perl5/5.10/getcwd.pl new file mode 100644 index 00000000000..eca6ba1127e --- /dev/null +++ b/chromium/third_party/cygwin/lib/perl5/5.10/getcwd.pl @@ -0,0 +1,71 @@ +# By Brandon S. Allbery +# +# This library is no longer being maintained, and is included for backward +# compatibility with Perl 4 programs which may require it. +# +# In particular, this should not be used as an example of modern Perl +# programming techniques. +# +# Suggested alternative: Cwd +# +# +# Usage: $cwd = &getcwd; + +sub getcwd +{ + local($dotdots, $cwd, @pst, @cst, $dir, @tst); + + unless (@cst = stat('.')) + { + warn "stat(.): $!"; + return ''; + } + $cwd = ''; + do + { + $dotdots .= '/' if $dotdots; + $dotdots .= '..'; + @pst = @cst; + unless (opendir(getcwd'PARENT, $dotdots)) #')) + { + warn "opendir($dotdots): $!"; + return ''; + } + unless (@cst = stat($dotdots)) + { + warn "stat($dotdots): $!"; + closedir(getcwd'PARENT); #'); + return ''; + } + if ($pst[$[] == $cst[$[] && $pst[$[ + 1] == $cst[$[ + 1]) + { + $dir = ''; + } + else + { + do + { + unless (defined ($dir = readdir(getcwd'PARENT))) #')) + { + warn "readdir($dotdots): $!"; + closedir(getcwd'PARENT); #'); + return ''; + } + unless (@tst = lstat("$dotdots/$dir")) + { + # warn "lstat($dotdots/$dir): $!"; + # closedir(getcwd'PARENT); #'); + # return ''; + } + } + while ($dir eq '.' || $dir eq '..' || $tst[$[] != $pst[$[] || + $tst[$[ + 1] != $pst[$[ + 1]); + } + $cwd = "$dir/$cwd"; + closedir(getcwd'PARENT); #'); + } while ($dir ne ''); + chop($cwd); + $cwd; +} + +1; |