- }
-
-
-/*
- * pattern2() - searches for patn within search string, returns pos
- */
-int pattern2(char *search, char *patn)
-{
- int a;
- for (a=0; a<strlen(search); ++a) {
- if (!struncmp(&search[a],patn,strlen(patn))) return(a);
- }
- return(-1);
- }
-
-
-/*
- * mesg_locate() - locate a message or help file, case insensitive
- */
-void mesg_locate(char *targ, char *searchfor, int numdirs, char **dirs)
-{
- int a;
- char buf[256];
- FILE *ls;
-
- for (a=0; a<numdirs; ++a) {
- sprintf(buf,"cd %s; exec ls",dirs[a]);
- ls = (FILE *) popen(buf,"r");
- if (ls != NULL) {
- while(fgets(buf,255,ls)!=NULL) {
- while (isspace(buf[strlen(buf)-1]))
- buf[strlen(buf)-1] = 0;
- if (!strucmp(buf,searchfor)) {
- pclose(ls);
- sprintf(targ,"%s/%s",dirs[a],buf);
- return;
- }
- }
- pclose(ls);
- }
- }
- strcpy(targ,"");
- }
-
-
-#ifdef NO_STRERROR
-/*
- * replacement strerror() for systems that don't have it
- */
-char *strerror(e)
-int e; {
- static char buf[32];
-
- sprintf(buf,"errno = %d",e);
- return(buf);
- }
-#endif
-