Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: pkg/compiler/lib/src/apiimpl.dart

Issue 1290643007: dart2js: remove trailing 0 byte when reading .packages (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/apiimpl.dart
diff --git a/pkg/compiler/lib/src/apiimpl.dart b/pkg/compiler/lib/src/apiimpl.dart
index f8695bba1a20c7753c52781d8779c343dd1e4c7a..f274c5e9482572e90897552bcb0a7652ac0a3529 100644
--- a/pkg/compiler/lib/src/apiimpl.dart
+++ b/pkg/compiler/lib/src/apiimpl.dart
@@ -392,6 +392,12 @@ class Compiler extends leg.Compiler {
if (packageConfigContents is String) {
packageConfigContents = UTF8.encode(packageConfigContents);
}
+ // The input provider may put a trailing 0 byte when it reads a source
Siggi Cherem (dart-lang) 2015/08/13 00:52:19 I'm surprised that we get a null terminated string
Harry Terkelsen 2015/08/13 17:02:41 I asked Johnni about it this morning. It apparentl
+ // file, which confuses the package config parser.
+ if (packageConfigContents.length > 0
+ && packageConfigContents.last == 0) {
+ packageConfigContents = packageConfigContents.removeLast();
+ }
packages =
new MapPackages(pkgs.parse(packageConfigContents, packageConfig));
});
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698