Skip to content

Commit

Permalink
Another update to the vs9->vs8 converter, to use appropriate line end…
Browse files Browse the repository at this point in the history
…ings.

git-svn-id: http://eathena.googlecode.com/svn/trunk@13084 9c4de8d1-4af9-ca9b-867f-b47ac08f6c80
  • Loading branch information
theultramage committed Aug 16, 2008
1 parent acfb18a commit b2e8195
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions tools/vs9-to-vs8.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php
// Visual Studio 9 to Visual Studio 8 project file converter
// author : theultramage
// version: 15. august 2008
// version: 16. august 2008
?>
<?php
fprintf(STDERR, "VS9 to VS8 project file converter"."\n");
fprintf(STDERR, "---------------------------------"."\n");
fwrite(STDERR, "VS9 to VS8 project file converter".PHP_EOL);
fwrite(STDERR, "---------------------------------".PHP_EOL);
if( @$_SERVER["argc"] < 2 )
{
fprintf(STDERR, "Usage: {$_SERVER["argv"][0]} file.vcproj"."\n");
fwrite(STDERR, "Usage: {$_SERVER["argv"][0]} file.vcproj".PHP_EOL);
exit();
}

Expand All @@ -17,15 +17,18 @@
if( $data === FALSE )
die("invalid input file '".$input."'");

fprintf(STDERR, "Converting {$input}...");
fwrite(STDERR, "Converting {$input}...".PHP_EOL);

$eol = ( strstr($data[0], "\r\n") !== FALSE ) ? "\r\n" : "\n";
define("EOL", $eol);

foreach( $data as $line )
{
if( strstr($line,'Version="9,00"') !== FALSE )
fprintf(STDOUT, "\t".'Version="8,00"'."\n");
fwrite(STDOUT, "\t".'Version="8,00"'.EOL);
else
if( strstr($line,'Version="9.00"') !== FALSE )
fprintf(STDOUT, "\t".'Version="8.00"'."\n");
fwrite(STDOUT, "\t".'Version="8.00"'.EOL);
else
if( strstr($line,'TargetFrameworkVersion') !== FALSE )
;
Expand All @@ -36,8 +39,8 @@
if( strstr($line,'DataExecutionPrevention') !== FALSE )
;
else // default
fprintf(STDOUT, $line);
fwrite(STDOUT, $line);
}

fprintf(STDERR, "done."."\n");
fwrite(STDERR, "done.".PHP_EOL);
?>

0 comments on commit b2e8195

Please sign in to comment.