X-Git-Url: https://git.distorted.org.uk/~mdw/checkpath/blobdiff_plain/7868d789c2b2f6a074b7fc14cd4dc482957c90b5..463b66afc93c5a712f9f9ab71efc53e0e05c5a9c:/chkpath.c diff --git a/chkpath.c b/chkpath.c index 250e922..5d7e01d 100644 --- a/chkpath.c +++ b/chkpath.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: chkpath.c,v 1.2 2001/01/25 22:16:02 mdw Exp $ + * $Id: chkpath.c,v 1.4 2004/04/08 01:36:22 mdw Exp $ * * Check a user's file search path * @@ -26,17 +26,6 @@ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*----- Revision history --------------------------------------------------* - * - * $Log: chkpath.c,v $ - * Revision 1.2 2001/01/25 22:16:02 mdw - * Make flags be unsigned. - * - * Revision 1.1.1.1 1999/04/06 20:12:07 mdw - * Import new project. - * - */ - /*----- Header files ------------------------------------------------------*/ #include @@ -50,11 +39,11 @@ #include #include -#include "path.h" +#include "checkpath.h" /*----- Main code ---------------------------------------------------------*/ -static void report(int what, int verbose, +static void report(unsigned what, int verbose, const char *p, const char *msg, void *arg) { @@ -106,10 +95,10 @@ Options provided are:\n\ int main(int argc, char *argv[]) { - int bad = 0; + unsigned bad = 0; int i; char *p, *q, *path; - struct chkpath cp; + struct checkpath cp; int f = 0; #define f_print 1u @@ -122,11 +111,10 @@ int main(int argc, char *argv[]) /* --- Set up path scanning defaults --- */ cp.cp_verbose = 1; - cp.cp_what = (CP_WRWORLD | CP_WRGRP | CP_WROTHUSR | - CP_ERROR | CP_REPORT | CP_SYMLINK); + cp.cp_what = CP_PROBLEMS | CP_REPORT | CP_SYMLINK; cp.cp_report = report; cp.cp_arg = 0; - path_setids(&cp); + checkpath_setids(&cp); /* --- Parse the options --- */ @@ -196,7 +184,7 @@ int main(int argc, char *argv[]) p = xstrdup(argv[i]); q = strtok(p, ":"); while (q) { - int b = path_check(q, &cp); + unsigned b = checkpath(q, &cp); if (!b && (f & f_print)) { if (f & f_colon) putchar(':');