File: pattern_match.hc

package info (click to toggle)
craft 3.5-10
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 18,000 kB
  • ctags: 1,602
  • sloc: cpp: 3,794; makefile: 2,319; ansic: 857; sh: 385
file content (18 lines) | stat: -rw-r--r-- 375 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "string.h"

#include "pattern_match.h"
#include "xstring.h"

bool p_match (char string [], char pattern [])
  {char correct_tail [128];

   strcpy (correct_tail, substring (pattern, 1));
   return tail_correct;

.  tail_correct
     (strcmp (string_tail, correct_tail) == 0).

.  string_tail 
     (substring (string, strlen (string) - strlen (correct_tail))).

  }