Index: lib/Tooling/JsonCompileCommandLineDatabase.h
===================================================================
--- lib/Tooling/JsonCompileCommandLineDatabase.h	(revision 130990)
+++ lib/Tooling/JsonCompileCommandLineDatabase.h	(working copy)
@@ -78,7 +78,7 @@
                                CompileCommandHandler *CommandHandler);
 
   /// \brief Parses the specified input. Returns true if no parsing errors were
-  /// foudn.
+  /// found.
   bool Parse();
 
   /// \brief Returns an error message if Parse() returned false previously.
Index: examples/Tooling/ClangCheck.cpp
===================================================================
--- examples/Tooling/ClangCheck.cpp	(revision 130990)
+++ examples/Tooling/ClangCheck.cpp	(working copy)
@@ -93,6 +93,10 @@
         clang::tooling::FindCompileArgsInJsonDatabase(
             File.str(), JsonDatabase->getBuffer(), ErrorMessage);
     if (!LookupResult.CommandLine.empty()) {
+      if (LookupResult.Directory.size()) {
+        LookupResult.CommandLine.push_back(
+            "-working-directory=" + LookupResult.Directory);
+      }
       if (!clang::tooling::RunToolWithFlags(
                new clang::SyntaxOnlyAction,
                LookupResult.CommandLine.size(),
