rename compath to compress_path
This commit is contained in:
14
source/dir.c
14
source/dir.c
@ -146,7 +146,7 @@ static void addsrcdir(char *dir) {
|
||||
struct stat statstruct;
|
||||
|
||||
/* make sure it is a directory */
|
||||
if(lstat(compath(dir), &statstruct) == 0 && S_ISDIR(statstruct.st_mode)) {
|
||||
if(lstat(compress_path(dir), &statstruct) == 0 && S_ISDIR(statstruct.st_mode)) {
|
||||
|
||||
/* note: there already is a source directory list */
|
||||
if(nsrcdirs == msrcdirs) {
|
||||
@ -197,7 +197,7 @@ static void addincdir(char *name, char *path) {
|
||||
struct stat statstruct;
|
||||
|
||||
/* make sure it is a directory */
|
||||
if(lstat(compath(path), &statstruct) == 0 && S_ISDIR(statstruct.st_mode)) {
|
||||
if(lstat(compress_path(path), &statstruct) == 0 && S_ISDIR(statstruct.st_mode)) {
|
||||
if(incdirs == NULL) {
|
||||
incdirs = malloc(mincdirs * sizeof(*incdirs));
|
||||
incnames = malloc(mincdirs * sizeof(*incnames));
|
||||
@ -551,7 +551,7 @@ void incfile(char *file, char *type) {
|
||||
(int)(PATHLEN - 2 - file_len),
|
||||
incdirs[i],
|
||||
file);
|
||||
if(access(compath(path), READ) == 0) {
|
||||
if(access(compress_path(path), READ) == 0) {
|
||||
addsrcfile(path);
|
||||
break;
|
||||
}
|
||||
@ -563,7 +563,7 @@ void incfile(char *file, char *type) {
|
||||
bool infilelist(char *path) {
|
||||
struct listitem *p;
|
||||
|
||||
for(p = srcnames[hash(compath(path)) % HASHMOD]; p != NULL; p = p->next) {
|
||||
for(p = srcnames[hash(compress_path(path)) % HASHMOD]; p != NULL; p = p->next) {
|
||||
if(strequal(path, p->text)) { return (true); }
|
||||
}
|
||||
return (false);
|
||||
@ -572,7 +572,7 @@ bool infilelist(char *path) {
|
||||
/* check if a file is readable enough to be allowed in the
|
||||
* database */
|
||||
static bool accessible_file(char *file) {
|
||||
if(access(compath(file), READ) == 0) {
|
||||
if(access(compress_path(file), READ) == 0) {
|
||||
struct stat stats;
|
||||
|
||||
if(lstat(file, &stats) == 0 && S_ISREG(stats.st_mode)) { return true; }
|
||||
@ -619,9 +619,9 @@ void addsrcfile(char *path) {
|
||||
srcfiles = realloc(srcfiles, msrcfiles * sizeof(*srcfiles));
|
||||
}
|
||||
/* add the file to the list */
|
||||
srcfiles[nsrcfiles++] = strdup(compath(path));
|
||||
srcfiles[nsrcfiles++] = strdup(compress_path(path));
|
||||
p = malloc(sizeof(*p));
|
||||
p->text = strdup(compath(path));
|
||||
p->text = strdup(compress_path(path));
|
||||
i = hash(p->text) % HASHMOD;
|
||||
p->next = srcnames[i];
|
||||
srcnames[i] = p;
|
||||
|
@ -36,7 +36,7 @@
|
||||
#include <stdio.h> /* need FILE* type def. */
|
||||
|
||||
/* private library */
|
||||
char *compath(char *pathname);
|
||||
char *compress_path(char *pathname);
|
||||
char *egrepinit(const char *egreppat);
|
||||
char *logdir(char *name);
|
||||
const char *basename(const char *path);
|
||||
|
@ -57,7 +57,7 @@ char *pathcomponents(char *path, int components) {
|
||||
}
|
||||
|
||||
/*
|
||||
* compath(pathname)
|
||||
* compress_path(pathname)
|
||||
*
|
||||
* This compresses pathnames. All strings of multiple slashes are
|
||||
* changed to a single slash. All occurrences of "./" are removed.
|
||||
@ -69,8 +69,7 @@ char *pathcomponents(char *path, int components) {
|
||||
* of accidently changing strings obtained from makefiles
|
||||
* and stored in global structures.
|
||||
*/
|
||||
|
||||
char *compath(char *pathname) /*FDEF*/
|
||||
char *compress_path(char *pathname) /*FDEF*/
|
||||
{
|
||||
char *nextchar;
|
||||
char *lastchar;
|
||||
|
Reference in New Issue
Block a user