~mdw
/
checkpath
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
infra: Clean up project setup
[checkpath]
/
chkpath.c
diff --git
a/chkpath.c
b/chkpath.c
index
e90b0d7
..
5d7e01d
100644
(file)
--- a/
chkpath.c
+++ b/
chkpath.c
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-c-*-
*
- * $Id: chkpath.c,v 1.
1 1999/04/06 20:12:07
mdw Exp $
+ * $Id: chkpath.c,v 1.
4 2004/04/08 01:36:22
mdw Exp $
*
* Check a user's file search path
*
*
* Check a user's file search path
*
@@
-26,14
+26,6
@@
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-/*----- Revision history --------------------------------------------------*
- *
- * $Log: chkpath.c,v $
- * Revision 1.1 1999/04/06 20:12:07 mdw
- * Initial revision
- *
- */
-
/*----- Header files ------------------------------------------------------*/
#include <errno.h>
/*----- Header files ------------------------------------------------------*/
#include <errno.h>
@@
-47,11
+39,11
@@
#include <mLib/quis.h>
#include <mLib/report.h>
#include <mLib/quis.h>
#include <mLib/report.h>
-#include "path.h"
+#include "
check
path.h"
/*----- Main code ---------------------------------------------------------*/
/*----- Main code ---------------------------------------------------------*/
-static void report(
int
what, int verbose,
+static void report(
unsigned
what, int verbose,
const char *p, const char *msg,
void *arg)
{
const char *p, const char *msg,
void *arg)
{
@@
-103,16
+95,14
@@
Options provided are:\n\
int main(int argc, char *argv[])
{
int main(int argc, char *argv[])
{
-
int
bad = 0;
+
unsigned
bad = 0;
int i;
char *p, *q, *path;
int i;
char *p, *q, *path;
- struct chkpath cp;
+ struct ch
ec
kpath cp;
int f = 0;
int f = 0;
- enum {
- f_print = 1,
- f_colon = 2
- };
+#define f_print 1u
+#define f_colon 2u
/* --- Initialize the world --- */
/* --- Initialize the world --- */
@@
-121,11
+111,10
@@
int main(int argc, char *argv[])
/* --- Set up path scanning defaults --- */
cp.cp_verbose = 1;
/* --- 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;
cp.cp_report = report;
cp.cp_arg = 0;
- path_setids(&cp);
+
check
path_setids(&cp);
/* --- Parse the options --- */
/* --- Parse the options --- */
@@
-195,7
+184,7
@@
int main(int argc, char *argv[])
p = xstrdup(argv[i]);
q = strtok(p, ":");
while (q) {
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(':');
if (!b && (f & f_print)) {
if (f & f_colon)
putchar(':');