Lines 35-47
Link Here
|
35 |
static char qfile_rcsid[] = "$Id: qfile.c,v 1.42 2007/01/13 19:17:39 solar Exp $"; |
35 |
static char qfile_rcsid[] = "$Id: qfile.c,v 1.42 2007/01/13 19:17:39 solar Exp $"; |
36 |
#define qfile_usage(ret) usage(ret, QFILE_FLAGS, qfile_long_opts, qfile_opts_help, lookup_applet_idx("qfile")) |
36 |
#define qfile_usage(ret) usage(ret, QFILE_FLAGS, qfile_long_opts, qfile_opts_help, lookup_applet_idx("qfile")) |
37 |
|
37 |
|
38 |
static inline short qfile_is_prefix(const char* path, const char* prefix, int prefix_length) |
38 |
#define qfile_is_prefix(path, prefix, prefix_length) \ |
39 |
{ |
39 |
(!prefix_length \ |
40 |
return !prefix_length |
40 |
|| (strlen(path) >= prefix_length \ |
41 |
|| (strlen(path) >= prefix_length |
41 |
&& (path[prefix_length] == '/' || path[prefix_length] == '\0') \ |
42 |
&& (path[prefix_length] == '/' || path[prefix_length] == '\0') |
42 |
&& !strncmp(path, prefix, prefix_length))) |
43 |
&& !strncmp(path, prefix, prefix_length)); |
|
|
44 |
} |
45 |
|
43 |
|
46 |
typedef struct { |
44 |
typedef struct { |
47 |
int length; |
45 |
int length; |