From 954550438a98d4917f911bff3af83e68e10d9f39 Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Wed, 9 Jun 2010 00:10:05 -0500 Subject: [PATCH] CGI no longer assumes CWD --- tartans/design.cgi | 2 ++ toys/crunt.cgi | 2 ++ toys/smalltalk.cgi | 2 ++ 3 files changed, 6 insertions(+) diff --git a/tartans/design.cgi b/tartans/design.cgi index da1182d..089a37d 100755 --- a/tartans/design.cgi +++ b/tartans/design.cgi @@ -7,6 +7,8 @@ import urllib import os import sys +os.chdir(os.path.dirname(sys.argv[0])) + f = cgi.FieldStorage() s = f.getfirst('sett') diff --git a/toys/crunt.cgi b/toys/crunt.cgi index a801fe0..efe3aaf 100755 --- a/toys/crunt.cgi +++ b/toys/crunt.cgi @@ -1,5 +1,7 @@ #! /bin/sh +cd $(dirname $0) + randint () { seq $1 $2 | shuf -n 1 } diff --git a/toys/smalltalk.cgi b/toys/smalltalk.cgi index bf812ea..f984540 100755 --- a/toys/smalltalk.cgi +++ b/toys/smalltalk.cgi @@ -1,5 +1,7 @@ #! /bin/sh +cd $(dirname $0) + intro () { shuf -n 1 <