Skip to content

Commit

Permalink
dart2js: remove trailing 0 byte when reading .packages
Browse files Browse the repository at this point in the history
  • Loading branch information
harryterkelsen authored and whesse committed Aug 20, 2015
1 parent 7f78948 commit 1aecb65
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/compiler/lib/src/apiimpl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,13 @@ 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
// file, which confuses the package config parser.
if (packageConfigContents.length > 0
&& packageConfigContents.last == 0) {
packageConfigContents = packageConfigContents.sublist(
0, packageConfigContents.length - 1);
}
packages =
new MapPackages(pkgs.parse(packageConfigContents, packageConfig));
});
Expand Down

0 comments on commit 1aecb65

Please sign in to comment.