* Usage: as CGI script, but called by userv
* environment variables are USERV_U_E_...
*/
+/*
+ * Copyright (C) 1998-1999,2003 Ian Jackson
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with userv-utils; if not, write to the Free Software
+ * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Id$
+ */
#include <stdio.h>
#include <string.h>
#include "ucgi.h"
-static void *xrealloc(void *ptr, size_t sz) {
- void *r;
-
- r= realloc(ptr,sz);
- if (!r) syserror("realloc failed");
- return r;
-}
-
int main(int argc, const char **argv) {
char *uservarn, *scriptpath, *newvar;
const char *nextslash, *lastslash, *pathi, *ev, *ev2, *en, *scriptdir, *av;
if (scriptpath[scriptpathlen-1]=='~') error("bad char end");
r= stat(scriptpath,&stab); if (r) syserror("stat script");
if (S_ISREG(stab.st_mode)) break;
- if (!S_ISDIR(stab.st_mode)) syserror("script not directory or file");
+ if (!S_ISDIR(stab.st_mode)) error("script not directory or file");
lastslash= nextslash;
}
if (*nextslash) xsetenv("PATH_INFO",nextslash,1);