3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-22 20:09:43 +01:00

Added extra semi-colon before return 0 to allow statements without semi-colons for lazy people; codepad.pl wasn't handling structs correctly because code and precode were backwards -- fixed

This commit is contained in:
Pragmatic Software 2010-06-30 01:21:46 +00:00
parent a4cdb2204f
commit 1f82cbc285
3 changed files with 4 additions and 4 deletions

View File

@ -13,7 +13,7 @@ use warnings;
# These are set automatically by the build/commit script
use constant {
BUILD_NAME => "PBot",
BUILD_REVISION => 217,
BUILD_REVISION => 218,
BUILD_DATE => "2010-06-29",
};

View File

@ -87,9 +87,9 @@ if($lang eq "C" or $lang eq "C++") {
$precode =~ s/\s+$//;
if(not $has_main) {
$code = "$prelude\n\n$code\n\nint main(int argc, char **argv) { $precode return 0;}\n";
$code = "$prelude\n\n$code\n\nint main(int argc, char **argv) { $precode\n;\n return 0;}\n";
} else {
$code = "$prelude\n\n$code\n\n$precode\n";
$code = "$prelude\n\n$precode\n\n$code\n";
}
} else {
$code = $precode;

View File

@ -569,7 +569,7 @@ if($languages{$lang}{'id'} == 1 or $languages{$lang}{'id'} == 11 or $languages{$
$precode =~ s/\s+$//;
if(not $has_main) {
$code = "$prelude\n\n$code\n\nint main(int argc, char **argv) { $precode return 0;}\n";
$code = "$prelude\n\n$code\n\nint main(int argc, char **argv) { $precode\n;\n return 0;}\n";
$nooutput = "Success [no output].";
} else {
$code = "$prelude\n\n$precode\n\n$code\n";