om

om - the most recently modified file in a directory
git clone git://git.larryhynes.net/om
Log | Files | Refs | README

commit 147850cb964bcbc74e2b630b5af0967c870b7587
parent 1db9ac5bc643132ed1483fc9c3289cfd4c86c284
Author: Larry Hynes <larry@larryhynes.com>
Date:   Mon,  3 Jul 2017 14:35:49 +0100

Tidy 'if's

Diffstat:
om.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/om.c b/om.c @@ -31,7 +31,7 @@ char *strp() { size_t len = strlen(dir); - if((len > 0) && (dir[len -1] == '/')) + if ((len > 0) && (dir[len -1] == '/')) dir[len -1] = '\0'; return dir; } @@ -51,7 +51,7 @@ om() while ((ent = readdir(dirp)) != NULL) { snprintf(buf, sizeof(buf), "%s/%s", dir, ent->d_name); stat(buf, &sb); - if(S_ISREG(sb.st_mode)) { + if (S_ISREG(sb.st_mode)) { stat(buf, &sb); if (sb.st_mtime > mtime) { snprintf(res, sizeof(res), "%s", ent->d_name ); @@ -69,7 +69,7 @@ int chck() { size_t len=strlen(res); - if(len == 0) + if (len == 0) exit(0); return 0; }