diff options
| author | cassiopc <cassiopc@gmail.com> | 2012-08-08 17:52:19 +0000 |
|---|---|---|
| committer | cassiopc <cassiopc@gmail.com> | 2012-08-08 17:52:19 +0000 |
| commit | 5d4eca5257a60c5f1de043fdf3f67e0a9df011f4 (patch) | |
| tree | 6d4ec6ffe1b6490be4120c0f06ae6cdabca41dd8 /boca-1.5.0/doc/problemexamples/problemtemplate/run/c | |
| parent | f8c7c32e3ea6417ccf04309ec521b39a0c20414d (diff) | |
| download | boca-5d4eca5257a60c5f1de043fdf3f67e0a9df011f4.tar.gz boca-5d4eca5257a60c5f1de043fdf3f67e0a9df011f4.zip | |
many small bug fixes
Diffstat (limited to 'boca-1.5.0/doc/problemexamples/problemtemplate/run/c')
| -rwxr-xr-x | boca-1.5.0/doc/problemexamples/problemtemplate/run/c | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/boca-1.5.0/doc/problemexamples/problemtemplate/run/c b/boca-1.5.0/doc/problemexamples/problemtemplate/run/c index d65ed58..75720ee 100755 --- a/boca-1.5.0/doc/problemexamples/problemtemplate/run/c +++ b/boca-1.5.0/doc/problemexamples/problemtemplate/run/c @@ -65,16 +65,11 @@ if [ "$1" == "" -o "$2" == "" -o "$3" == "" ]; then echo "parameter problem" exit 43 fi -name=`basename "$1"` -if [ ! -x "$name" ]; then +if [ ! -x "$1" ]; then echo "$1 not found (or is not in the current dir) or it's not executable" exit 44 fi -if [ "${name##*.}" != "exe" -a "${name##*.}" != "EXE" ]; then - echo "WARNING: executable file extension is not .exe" -fi -input=`basename "$2"` -if [ ! -r "$input" ]; then +if [ ! -r "$2" ]; then echo "$2 not found (or is not in the current dir) or it's not readable" exit 45 fi @@ -92,22 +87,24 @@ else fi nruns=1 -if [ "$4" != "" -a "$4" -gt "0" ]; then -nruns=$4 +if [ "$4" != "" ]; then + if [ "$4" -gt "0" ]; then + nruns=$4 + fi fi maxm=512000 -if [ "$5" != "" -a "$5" -gt "0" ]; then -maxm=${5}000 +if [ "$5" != "" ]; then + if [ "$5" -gt "0" ]; then + maxm=${5}000 + fi fi -rm -f stdin0 2>/dev/null -mv "$input" stdin0 +cp "$2" stdin0 2>/dev/null +cp "$1" run.exe 2>/dev/null -rm -f run.exe 2>/dev/null -mv "$name" run.exe file run.exe | grep -iq "statically linked" if [ "$?" != "0" ]; then - echo "Aborting because $name is not statically linked" + echo "Aborting because $1 is not statically linked" exit 47 fi |