public
/
UglifyJS.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
13c4dfc
)
Fixed reading from STDIN.
author
Visa Kopu
<visa@2general.com>
Thu, 29 Nov 2012 08:51:15 +0000
(10:51 +0200)
committer
Visa Kopu
<visa@2general.com>
Thu, 29 Nov 2012 08:51:15 +0000
(10:51 +0200)
bin/uglifyjs
patch
|
blob
|
history
diff --git
a/bin/uglifyjs
b/bin/uglifyjs
index
1706629
..
d2fbdb1
100755
(executable)
--- a/
bin/uglifyjs
+++ b/
bin/uglifyjs
@@
-335,9
+335,8
@@
function getOptions(x, constants) {
function read_whole_file(filename) {
if (filename == "-") {
- // XXX: this sucks. How does one read the whole STDIN
- // synchronously?
- filename = "/dev/stdin";
+ var size = fs.fstatSync(process.stdin.fd).size;
+ return size > 0 ? fs.readSync(process.stdin.fd, size)[0] : "";
}
try {
return fs.readFileSync(filename, "utf8");