home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume11 / watcher / part01 / find_pre_cmd.c < prev    next >
Encoding:
C/C++ Source or Header  |  1987-09-27  |  441 b   |  25 lines

  1. /*
  2.    find_prev_cmd: find the previous results for this command (if any).  If
  3.    there is no match, then we return NULL.
  4.  
  5.    Kenneth Ingham
  6.  
  7.    Copyright (C) 1987 The University of New Mexico
  8. */
  9.  
  10. #include "defs.h"
  11.  
  12. struct old_cmd_st *
  13. find_prev_cmd(pipeline)
  14. char *pipeline;
  15. {
  16.     extern struct old_cmd_st *chead;
  17.     struct old_cmd_st *cp;
  18.  
  19.     cp = chead;
  20.     while (cp != NULL && strcmp(pipeline, cp->pipeline) != 0)
  21.         cp = cp->next;
  22.     
  23.     return cp;
  24. }
  25.