www-cgi/ucgitarget.c: Use `error' to report unusual filesystem object.
[userv-utils] / www-cgi / ucgitarget.c
index 795d804..4228951 100644 (file)
@@ -2,6 +2,25 @@
  * 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>
@@ -75,7 +94,7 @@ int main(int argc, const char **argv) {
     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);