From 03b520370f6185d8604bc4068e8ac319c67e8703 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 9 Aug 2011 14:14:46 -0400 Subject: Fix warning in roll.php, generate .gitignore on the fly --- .gitignore | 16 ++++++++++++++++ Makefile | 6 +++++- roll.php | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ea20e2a --- /dev/null +++ b/.gitignore @@ -0,0 +1,16 @@ +*~ +arg +ord +urldecode +roll +v-www-browser +v-editor +whatismyip +chardiff +chardiff_pre +chardiff_post +newegg +hangman +sysfiles +daemon +emacsmail diff --git a/Makefile b/Makefile index a6866ab..e33f078 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ BINFILES = \ daemon \ emacsmail -all: build +all: build .gitignore build: $(BINFILES) @@ -40,3 +40,7 @@ clean: %: %.php cat $< >$@ chmod a+x $@ + +.gitignore: Makefile + echo '*~' > $@ + for file in $(BINFILES); do echo "$$file"; done >> $@ diff --git a/roll.php b/roll.php index 0d8aa25..d888f64 100644 --- a/roll.php +++ b/roll.php @@ -6,7 +6,7 @@ $string = $argv[1]; preg_match('/([0-9]*)d([0-9]+)(([+-][0-9]+))?/', $string, $matches); $dice = (int)$matches[1]; $die_size = (int)$matches[2]; -$mod = (int)$matches[3]; +@$mod = (int)$matches[3]; if ($dice<1) $dice = 1; -- cgit v1.2.3