]> granicus.if.org Git - clang/commitdiff
improve compatibility with GCC: when generating the ".d" filename to use
authorChris Lattner <sabre@nondot.org>
Sun, 16 Jan 2011 08:14:11 +0000 (08:14 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 16 Jan 2011 08:14:11 +0000 (08:14 +0000)
and the filename has multiple .'s in it, use the last.  For example, "foo.bar.cpp"
should produce "foo.bar.d" not "foo.d".  Patch by Johan Boule in PR8391

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123576 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp

index ba2d32328ce00b0b29a18f9f3e44d938b338c8c0..e245f78870929726a9d9bbd9fbf35ad7f899304a 100644 (file)
@@ -1964,7 +1964,7 @@ const char *darwin::CC1::getBaseInputStem(const ArgList &Args,
                                           const InputInfoList &Inputs) {
   const char *Str = getBaseInputName(Args, Inputs);
 
-  if (const char *End = strchr(Str, '.'))
+  if (const char *End = strrchr(Str, '.'))
     return Args.MakeArgString(std::string(Str, End));
 
   return Str;