This commit is contained in:
tTh 2022-11-27 10:29:55 +01:00
parent 690eb06973
commit 34ed1e8121
4 changed files with 9 additions and 12 deletions

View File

@ -51,8 +51,7 @@ hexdiff: Makefile $(OBJECTS)
install: install:
cp hexdiff hexdiff.install cp hexdiff hexdiff.install
strip hexdiff.install strip hexdiff.install
cp hexdiff.install $(OU_LE_METTRE)/bin/hexdiff mv hexdiff.install $(OU_LE_METTRE)/bin/hexdiff
rm hexdiff.install
cp hexdiff.1 $(OU_LE_METTRE)/man/man1/hexdiff.1 cp hexdiff.1 $(OU_LE_METTRE)/man/man1/hexdiff.1
@echo "you can copy hexdiff.rc in your HOME as .hexdiffrc" @echo "you can copy hexdiff.rc in your HOME as .hexdiffrc"

View File

@ -28,9 +28,9 @@
static void prtime(time_t t, char *pstr) static void prtime(time_t t, char *pstr)
{ {
struct tm *ptm; struct tm *ptm;
int foo;
ptm = gmtime(&t); ptm = gmtime(&t);
foo = strftime(pstr, 99, "%Y-%m-%d %H:%M:%S", ptm); strftime(pstr, 99, "%Y-%m-%d %H:%M:%S", ptm);
} }
/*----------------------------------------------------------------*/ /*----------------------------------------------------------------*/
#define W_FILEINFO 48 #define W_FILEINFO 48

View File

@ -33,17 +33,14 @@ struct stat statbuf;
Fichier *fichier; Fichier *fichier;
long offset; long offset;
if ( (fd=open(nom, O_RDONLY)) < 0) if ( (fd=open(nom, O_RDONLY)) < 0) {
{
return 0; return 0;
} }
if (fenetre_active==0) if (fenetre_active==0) {
{
fichier = &f1; offset = f2.offset; fichier = &f1; offset = f2.offset;
} }
else else {
{
fichier = &f2; offset = f1.offset; fichier = &f2; offset = f1.offset;
} }
@ -57,6 +54,7 @@ close(fichier->fd);
*/ */
strncpy(fichier->nom, nom, T_NOM); strncpy(fichier->nom, nom, T_NOM);
foo = fstat(fd, &statbuf); foo = fstat(fd, &statbuf);
if (foo) perror(__func__);
fichier->fd = fd; fichier->fd = fd;
fichier->taille = statbuf.st_size; fichier->taille = statbuf.st_size;
fichier->offset = offset; fichier->offset = offset;

View File

@ -45,6 +45,7 @@ static int teste_dirent(const struct dirent *de, struct stat *pstat)
int foo; int foo;
foo = stat(de->d_name, pstat); foo = stat(de->d_name, pstat);
if (foo) perror(__func__);
if (S_ISDIR(pstat->st_mode)) if (S_ISDIR(pstat->st_mode))
return 0; return 0;
@ -109,7 +110,6 @@ static int liste_fichiers(WINDOW *win, int flag)
DIR *dir; DIR *dir;
struct dirent *de; struct dirent *de;
struct stat statbuf; struct stat statbuf;
int foo;
/* /*
* initializing local vars, for list-of-files * initializing local vars, for list-of-files
@ -154,7 +154,7 @@ while ( (de=readdir(dir)) != NULL)
} }
} }
foo = closedir(dir); closedir(dir);
return nombre; return nombre;
} }