summaryrefslogtreecommitdiff
path: root/tools/vs9-to-vs8.php
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-08-16 02:10:24 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-08-16 02:10:24 +0000
commit9468cefcb8c8a5569db110a4ef580c79cc0b2dcf (patch)
tree079a1b07405a30315280c17daaec60081604659e /tools/vs9-to-vs8.php
parenta22437d20d0afbfc699cd2ba8e7905965c0e884d (diff)
downloadhercules-9468cefcb8c8a5569db110a4ef580c79cc0b2dcf.tar.gz
hercules-9468cefcb8c8a5569db110a4ef580c79cc0b2dcf.tar.bz2
hercules-9468cefcb8c8a5569db110a4ef580c79cc0b2dcf.tar.xz
hercules-9468cefcb8c8a5569db110a4ef580c79cc0b2dcf.zip
Another update to the vs9->vs8 converter, to use appropriate line endings.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13084 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'tools/vs9-to-vs8.php')
-rw-r--r--tools/vs9-to-vs8.php21
1 files changed, 12 insertions, 9 deletions
diff --git a/tools/vs9-to-vs8.php b/tools/vs9-to-vs8.php
index f2f840592..9cc05fb76 100644
--- a/tools/vs9-to-vs8.php
+++ b/tools/vs9-to-vs8.php
@@ -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();
}
@@ -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 )
;
@@ -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);
?>