STYLE: Fix typo in GetFilenameLastExtension docs
[cmake.git] / Source / cmw9xcom.cxx
blob54ba9dcd090e3f80af239ec86b9ecb6031b7d618
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmw9xcom.cxx,v $
5 Language: C++
6 Date: $Date: 2002-12-11 16:49:08 $
7 Version: $Revision: 1.5 $
9 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
10 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
17 #include "cmSystemTools.h"
18 #include "cmWin32ProcessExecution.h"
20 // this is a test driver program for cmake.
21 int main (int argc, char *argv[])
23 cmSystemTools::EnableMSVCDebugHook();
24 if ( argc <= 1 )
26 std::cerr << "Usage: " << argv[0] << " executable" << std::endl;
27 return 1;
29 std::string arg = argv[1];
30 if ( (arg.find_first_of(" ") != arg.npos) &&
31 (arg.find_first_of("\"") == arg.npos) )
33 arg = "\"" + arg + "\"";
35 std::string command = arg;
36 int cc;
37 for ( cc = 2; cc < argc; cc ++ )
39 std::string arg = argv[cc];
40 if ( (arg.find_first_of(" ") != arg.npos) &&
41 (arg.find_first_of("\"") == arg.npos) )
43 arg = "\"" + arg + "\"";
45 command += " ";
46 command += arg;
49 return cmWin32ProcessExecution::Windows9xHack(command.c_str());