dlhist.c: use file_cmp from utils.h instead of static path_cmp.
This commit is contained in:
parent
c1b99a9e7e
commit
e85b3b7993
2 changed files with 3 additions and 12 deletions
2
Makefile
2
Makefile
|
|
@ -15,7 +15,7 @@ install : $(PROGRAMS)
|
|||
cp $^ $(HOME)/bin/
|
||||
|
||||
dlight : dlight.o buffer.o env.o http.o rss.o lockfile.o filter.o cconf.o \
|
||||
proc-cache.o dlhist.o hash.o xalloc.o error.o
|
||||
proc-cache.o dlhist.o hash.o xalloc.o error.o utils.o
|
||||
dlight-compile : compile.o buffer.o env.o lockfile.o filter.o cconf.o \
|
||||
error.o
|
||||
dlight-read-config : read-config.o buffer.o env.o cconf.o error.o
|
||||
|
|
|
|||
13
dlhist.c
13
dlhist.c
|
|
@ -29,6 +29,7 @@
|
|||
#include "env.h"
|
||||
#include "error.h"
|
||||
#include "lockfile.h"
|
||||
#include "utils.h"
|
||||
#include "dlhist.h"
|
||||
|
||||
/* \195 D L H */
|
||||
|
|
@ -291,16 +292,6 @@ error:
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int path_cmp(const char *a, const char *b) {
|
||||
|
||||
struct stat sa, sb;
|
||||
|
||||
if (stat(a, &sa) < 0 || stat(b, &sb) < 0)
|
||||
return 0;
|
||||
return sa.st_dev == sb.st_dev &&
|
||||
sa.st_ino == sb.st_ino;
|
||||
}
|
||||
|
||||
int dlhist_lookup(const char *title, const char *dest) {
|
||||
|
||||
struct hash_entry *he;
|
||||
|
|
@ -313,7 +304,7 @@ int dlhist_lookup(const char *title, const char *dest) {
|
|||
int i;
|
||||
for(i=0; i < he->dest_nr; i++) {
|
||||
|
||||
if (path_cmp(he->dest[i].path, dest))
|
||||
if (file_cmp(he->dest[i].path, dest))
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue