[mmotm:master 153/230] lib/glob.c:48:32: sparse: Using plain integer as NULL pointer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   git://git.cmpxchg.org/linux-mmotm.git master
head:   df25ba7db0775d87018e2cd92f26b9b087093840
commit: 31b8d64a94ed8129048a904cc07c11a05c2efd6f [153/230] libata: Use glob_match from lib/glob.c
reproduce: make C=1 CF=-D__CHECK_ENDIAN__

>> lib/glob.c:48:32: sparse: Using plain integer as NULL pointer

vim +48 lib/glob.c

37e65fe1 George Spelvin 2014-06-20  32   * treat / or leading . specially; it isn't actually used for pathnames.
37e65fe1 George Spelvin 2014-06-20  33   *
37e65fe1 George Spelvin 2014-06-20  34   * Note that according to glob(7) (and unlike bash), character classes
37e65fe1 George Spelvin 2014-06-20  35   * are complemented by a leading !; this does not support the regex-style
37e65fe1 George Spelvin 2014-06-20  36   * [^a-z] syntax.
37e65fe1 George Spelvin 2014-06-20  37   *
37e65fe1 George Spelvin 2014-06-20  38   * An opening bracket without a matching close is matched literally.
37e65fe1 George Spelvin 2014-06-20  39   */
37e65fe1 George Spelvin 2014-06-20  40  bool __pure glob_match(char const *pat, char const *str)
37e65fe1 George Spelvin 2014-06-20  41  {
37e65fe1 George Spelvin 2014-06-20  42  	/*
37e65fe1 George Spelvin 2014-06-20  43  	 * Backtrack to previous * on mismatch and retry starting one
37e65fe1 George Spelvin 2014-06-20  44  	 * character later in the string.  Because * matches all characters
37e65fe1 George Spelvin 2014-06-20  45  	 * (no exception for /), it can be easily proved that there's
37e65fe1 George Spelvin 2014-06-20  46  	 * never a need to backtrack multiple levels.
37e65fe1 George Spelvin 2014-06-20  47  	 */
37e65fe1 George Spelvin 2014-06-20 @48  	char const *back_pat = 0, *back_str = back_str;
37e65fe1 George Spelvin 2014-06-20  49  
37e65fe1 George Spelvin 2014-06-20  50  	/*
37e65fe1 George Spelvin 2014-06-20  51  	 * Loop over each token (character or class) in pat, matching
37e65fe1 George Spelvin 2014-06-20  52  	 * it against the remaining unmatched tail of str.  Return false
37e65fe1 George Spelvin 2014-06-20  53  	 * on mismatch, or true after matching the trailing nul bytes.
37e65fe1 George Spelvin 2014-06-20  54  	 */
37e65fe1 George Spelvin 2014-06-20  55  	for (;;) {
37e65fe1 George Spelvin 2014-06-20  56  		unsigned char c = *str++;



---
0-DAY kernel build testing backend              Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild                 Intel Corporation

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]