Ignore:
Timestamp:
Dec 27, 2010, 7:18:17 PM (10 years ago)
Author:
charles
Message:

(trunk) Join the 21st century and use only 1 space at the end sentences. This commit is nearly as important as the semi-annual ones that remove trailing spaces from the ends of lines of code... :)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/wildmat.c

    r10521 r11599  
    44**  Do shell-style pattern matching for ?, \, [], and * characters.
    55**  Might not be robust in face of malformed patterns; e.g., "foo[a-"
    6 **  could cause a segmentation violation.  It is 8bit clean.
     6**  could cause a segmentation violation. It is 8bit clean.
    77**
    88**  Written by Rich $alz, mirror!rs, Wed Nov 26 19:03:17 EST 1986.
     
    1212**
    1313**  Special thanks to Lars Mathiesen <thorinn@diku.dk> for the ABORT code.
    14 **  This can greatly speed up failing wildcard patterns.  For example:
     14**  This can greatly speed up failing wildcard patterns. For example:
    1515**      pattern: -*-*-*-*-*-*-12-*-*-*-m-*-*-*
    1616**      text 1:  -adobe-courier-bold-o-normal--12-120-75-75-m-70-iso8859-1
    1717**      text 2:  -adobe-courier-bold-o-normal--12-120-75-75-X-70-iso8859-1
    18 **  Text 1 matches with 51 calls, while text 2 fails with 54 calls.  Without
    19 **  the ABORT, then it takes 22310 calls to fail.  Ugh. The following
     18**  Text 1 matches with 51 calls, while text 2 fails with 54 calls. Without
     19**  the ABORT, then it takes 22310 calls to fail. Ugh. The following
    2020**  explanation is from Lars:
    2121**  The precondition that must be fulfilled is that DoMatch will consume
    22 **  at least one character in text.  This is true if *p is neither '*' nor
     22**  at least one character in text. This is true if *p is neither '*' nor
    2323**  '\0'.)  The last return has ABORT instead of FALSE to avoid quadratic
    24 **  behaviour in cases like pattern "*a*b*c*d" with text "abcxxxxx".  With
     24**  behaviour in cases like pattern "*a*b*c*d" with text "abcxxxxx". With
    2525**  FALSE, each star-loop has to run to the end of the text; with ABORT
    2626**  only the last one does.
     
    2929**  instance will return either TRUE or ABORT, and any calling instance
    3030**  will therefore return immediately after (without calling recursively
    31 **  again).  In effect, only one star-loop is ever active. It would be
     31**  again). In effect, only one star-loop is ever active. It would be
    3232**  possible to modify the code to maintain this context explicitly,
    3333**  eliminating all recursive calls at the cost of some complication and
    3434**  loss of clarity (and the ABORT stuff seems to be unclear enough by
    35 **  itself).  I think it would be unwise to try to get this into a
     35**  itself). I think it would be unwise to try to get this into a
    3636**  released version unless you have a good test data base to try it out
    3737**  on.
     
    111111
    112112/*
    113 **  User-level routine.  Returns TRUE or FALSE.
     113**  User-level routine. Returns TRUE or FALSE.
    114114*/
    115115int
Note: See TracChangeset for help on using the changeset viewer.