From 8c3e2902f81e9f09ab8ad26d006d2284698c19ad Mon Sep 17 00:00:00 2001 From: night0721 Date: Sun, 19 May 2024 13:16:48 +0000 Subject: [PATCH 1/2] Fix breaking in loop, and messages in README --- README.md | 10 ++++++++++ lcc.c | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8b2caf0..d0bfae2 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,16 @@ $ make # make install ``` +# Customizing + +You can modify `lcc.h` to add more languages to count lines, with the same format as provided in the file. + +You can also add directories name and file extensions to ignore when counting lines, but the length of `ignore_dir` must be matching `IGNORE_DIRS`. + +# Warning + +Result may not be 100% correct due to coding style, but from testing, code with [suckless coding style](https://suckless.org/coding_style) will be modt accurate due to different method of commenting in code. + # Contributions Contributions are welcomed, feel free to open a pull request. diff --git a/lcc.c b/lcc.c index dab7a28..657d496 100644 --- a/lcc.c +++ b/lcc.c @@ -101,7 +101,7 @@ void process_directory(const char *dirname) for (int i = 0; i < IGNORE_DIRS; i++) { if (strstr(entry->d_name, ignore_dir[i]) != NULL) { skip = 1; - continue; + break; } } if (skip) continue; From 2aa644e6312f739a00442fec96311cc20f7efdcb Mon Sep 17 00:00:00 2001 From: night0721 Date: Sun, 19 May 2024 13:18:21 +0000 Subject: [PATCH 2/2] fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d0bfae2..5dbd6a0 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ You can also add directories name and file extensions to ignore when counting li # Warning -Result may not be 100% correct due to coding style, but from testing, code with [suckless coding style](https://suckless.org/coding_style) will be modt accurate due to different method of commenting in code. +Result may not be 100% correct due to coding style, but from testing, code with [suckless coding style](https://suckless.org/coding_style) will be most accurate due to different method of commenting in code. # Contributions Contributions are welcomed, feel free to open a pull request.