mirror of
https://github.com/reactos/reactos.git
synced 2026-07-06 18:54:27 +08:00
added validation for <directory>'s name attribute
create dk/nkm/lib if it doesn't exist svn path=/branches/xmlbuildsystem/; revision=13994
This commit is contained in:
@@ -99,16 +99,20 @@ else # mingw32-windows
|
||||
NUL = NUL
|
||||
endif
|
||||
|
||||
ifneq ($(ROS_INTERMEDIATE),)
|
||||
$(ROS_INTERMEDIATE)tools: $(ROS_INTERMEDIATE)
|
||||
${nmkdir} $(ROS_INTERMEDIATE)tools
|
||||
endif
|
||||
|
||||
ifneq ($(ROS_INTERMEDIATE),)
|
||||
$(ROS_INTERMEDIATE):
|
||||
${nmkdir} $(ROS_INTERMEDIATE)
|
||||
$(ROS_INTERMEDIATE)tools: $(ROS_INTERMEDIATE)
|
||||
${nmkdir} $@
|
||||
$(ROS_INTERMEDIATE)dk: $(ROS_INTERMEDIATE)
|
||||
${nkmdir} $@
|
||||
$(ROS_INTERMEDIATE)dk$(SEP)nkm: $(ROS_INTERMEDIATE)dk
|
||||
${nkmdir} $@
|
||||
endif
|
||||
|
||||
$(ROS_INTERMEDIATE)dk$(SEP)nkm$(SEP)lib: $(ROS_INTERMEDIATE)dk$(SEP)nkm
|
||||
${nmkdir} $@
|
||||
|
||||
NTOSKRNL_MC = .$(SEP)ntoskrnl$(SEP)ntoskrnl.mc
|
||||
KERNEL32_MC = .$(SEP)lib$(SEP)kernel32$(SEP)kernel32.mc
|
||||
BUILDNO_H = .$(SEP)include$(SEP)reactos$(SEP)buildno.h
|
||||
|
||||
@@ -179,8 +179,8 @@ Path::RelativeFromWorkingDirectory ( const string& path )
|
||||
vout.push_back ( vpath[i++] );
|
||||
|
||||
// now merge vout into a string again
|
||||
string out = ".";
|
||||
for ( i = 0; i < vout.size(); i++ )
|
||||
string out = vout[0];
|
||||
for ( i = 1; i < vout.size(); i++ )
|
||||
{
|
||||
out += "/" + vout[i];
|
||||
}
|
||||
|
||||
@@ -19,6 +19,25 @@ FixSeparator ( const string& s )
|
||||
return s2;
|
||||
}
|
||||
|
||||
string
|
||||
GetSubPath (
|
||||
const string& location,
|
||||
const string& path,
|
||||
const string& att_value )
|
||||
{
|
||||
if ( !att_value.size() )
|
||||
throw InvalidBuildFileException (
|
||||
location,
|
||||
"<directory> tag has empty 'name' attribute" );
|
||||
if ( strpbrk ( att_value.c_str (), "/\\?*:<>|" ) )
|
||||
throw InvalidBuildFileException (
|
||||
location,
|
||||
"<directory> tag has invalid characters in 'name' attribute" );
|
||||
if ( !path.size() )
|
||||
return att_value;
|
||||
return FixSeparator(path + CSEP + att_value);
|
||||
}
|
||||
|
||||
string
|
||||
GetExtension ( const string& filename )
|
||||
{
|
||||
@@ -252,7 +271,7 @@ Module::ProcessXMLSubElement ( const XMLElement& e,
|
||||
{
|
||||
const XMLAttribute* att = e.GetAttribute ( "name", true );
|
||||
assert(att);
|
||||
subpath = FixSeparator ( path + CSEP + att->value );
|
||||
subpath = GetSubPath ( e.location, path, att->value );
|
||||
}
|
||||
else if ( e.name == "include" )
|
||||
{
|
||||
@@ -508,10 +527,10 @@ Module::GetDependencyPath () const
|
||||
{
|
||||
if ( HasImportLibrary () )
|
||||
{
|
||||
return ssprintf ( "dk%snkm%slib%slib%s.a",
|
||||
SSEP,
|
||||
SSEP,
|
||||
SSEP,
|
||||
return ssprintf ( "dk%cnkm%clib%clib%s.a",
|
||||
CSEP,
|
||||
CSEP,
|
||||
CSEP,
|
||||
name.c_str () );
|
||||
}
|
||||
else
|
||||
|
||||
@@ -182,7 +182,8 @@ Project::ReadXml ()
|
||||
if ( head->subElements[i]->name == "project" )
|
||||
{
|
||||
node = head->subElements[i];
|
||||
this->ProcessXML ( "." );
|
||||
string path;
|
||||
this->ProcessXML ( path );
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -254,7 +255,7 @@ Project::ProcessXMLSubElement ( const XMLElement& e,
|
||||
{
|
||||
const XMLAttribute* att = e.GetAttribute ( "name", true );
|
||||
assert(att);
|
||||
subpath = path + CSEP + att->value;
|
||||
subpath = GetSubPath ( e.location, path, att->value );
|
||||
}
|
||||
else if ( e.name == "include" )
|
||||
{
|
||||
|
||||
@@ -6,15 +6,17 @@
|
||||
#ifdef WIN32
|
||||
#include <direct.h>
|
||||
#include <io.h>
|
||||
#endif
|
||||
#endif/*WIN32*/
|
||||
#include <sys/stat.h>
|
||||
#include <time.h>
|
||||
#ifdef _MSC_VER
|
||||
#include <sys/utime.h>
|
||||
#else
|
||||
#else/*_MSC_VER*/
|
||||
#include <utime.h>
|
||||
#ifdef WIN32
|
||||
#include <process.h>
|
||||
#endif
|
||||
#endif/*WIN32*/
|
||||
#endif/*_MSC_VER*/
|
||||
|
||||
#include "ssprintf.h"
|
||||
#include "exception.h"
|
||||
@@ -524,10 +526,15 @@ public:
|
||||
void ProcessXML();
|
||||
};
|
||||
|
||||
|
||||
extern std::string
|
||||
FixSeparator ( const std::string& s );
|
||||
|
||||
extern std::string
|
||||
GetSubPath (
|
||||
const std::string& location,
|
||||
const std::string& path,
|
||||
const std::string& att_value );
|
||||
|
||||
extern std::string
|
||||
GetExtension ( const std::string& filename );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user