906 |
STRBUF *comline = strbuf_open(0); |
STRBUF *comline = strbuf_open(0); |
907 |
STRBUF *path_list = strbuf_open(MAXPATHLEN); |
STRBUF *path_list = strbuf_open(MAXPATHLEN); |
908 |
int path_list_max; |
int path_list_max; |
909 |
|
size_t rootlen = strlen(root); |
910 |
|
|
911 |
/* |
/* |
912 |
* teach parser where is dbpath. |
* teach parser where is dbpath. |
953 |
die("realpath(%s, buf) failed. (errno=%d).", av, errno); |
die("realpath(%s, buf) failed. (errno=%d).", av, errno); |
954 |
if (!isabspath(path)) |
if (!isabspath(path)) |
955 |
die("realpath(3) is not compatible with BSD version."); |
die("realpath(3) is not compatible with BSD version."); |
956 |
if (strncmp(path, root, strlen(root))) { |
if (strncmp(path, root, rootlen) || path[rootlen] != '/') { |
957 |
if (!qflag) |
if (!qflag) |
958 |
fprintf(stderr, "'%s' is out of source tree.\n", path); |
fprintf(stderr, "'%s' is out of source tree.\n", path); |
959 |
continue; |
continue; |
960 |
} |
} |
961 |
path += strlen(root) - 1; |
path += rootlen - 1; |
962 |
*path = '.'; |
*path = '.'; |
963 |
if (!gpath_path2fid(path)) { |
if (!gpath_path2fid(path)) { |
964 |
if (!qflag) |
if (!qflag) |