diary

Text-based journaling program
git clone https://git.in0rdr.ch/diary.git
Log | Files | Refs | README | LICENSE

commit 16c7fa4a3e701cbd26f01c563d94cb7106c28cd4
parent 33841662ab653fddfba67d2c86bb39acdcc2aa65
Author: in0rdr <andreas.gruhler@uzh.ch>
Date:   Mon, 21 Nov 2016 17:43:36 +0800

formatting, remove 'n' shortcut

Diffstat:
Mdiary.c | 22++++++----------------
1 file changed, 6 insertions(+), 16 deletions(-)

diff --git a/diary.c b/diary.c @@ -161,39 +161,30 @@ void setup_cal_timeframe() { mktime(&cal_end); } -int main(int argc, char** argv) -{ +int main(int argc, char** argv) { // Get the diary directory via environment variable or argument // If both are given, the argument takes precedence char* diary_dir = NULL; if (argc < 2) { diary_dir = getenv("DIARY_DIR"); - if (diary_dir == NULL) - { + if (diary_dir == NULL) { fprintf(stderr, "The diary directory must ge given as command line " "argument or in the DIARY_DIR environment variable\n"); return 1; } - } - else - { + } else { diary_dir = argv[1]; } // Check if that directory exists DIR* diary_dir_ptr = opendir(diary_dir); - if (diary_dir_ptr) - { + if (diary_dir_ptr) { // Directory exists, continue closedir(diary_dir_ptr); - } - else if (errno = ENOENT) - { + } else if (errno = ENOENT) { fprintf(stderr, "The directory '%s' does not exist\n", diary_dir); return 2; - } - else - { + } else { fprintf(stderr, "The directory '%s' could not be opened\n", diary_dir); return 1; } @@ -277,7 +268,6 @@ int main(int argc, char** argv) // Today shortcut case 't': - case 'n': new_date = cur_date; ret = go_to(cal, aside, raw_time, &pad_pos); break;