[PATCH 3/4] diff: change scope of the function count_lines()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Prathamesh Chavan <pc44800@xxxxxxxxx>

Change the scope of function count_lines for allowing the function
to be reused in other parts of the code as well.

Mentored-by: Christian Couder <christian.couder@xxxxxxxxx>
Mentored-by: Stefan Beller <sbeller@xxxxxxxxxx>
Mentored-by: Kaartic Sivaraam <kaartic.sivaraam@xxxxxxxxx>
Signed-off-by: Prathamesh Chavan <pc44800@xxxxxxxxx>
Signed-off-by: Shourya Shukla <shouryashukla.oo@xxxxxxxxx>
---
 diff.c | 2 +-
 diff.h | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/diff.c b/diff.c
index 4a2c631c37..39ddbcf451 100644
--- a/diff.c
+++ b/diff.c
@@ -547,7 +547,7 @@ struct emit_callback {
 	struct strbuf *header;
 };
 
-static int count_lines(const char *data, int size)
+int count_lines(const char *data, int size)
 {
 	int count, ch, completely_empty = 1, nl_just_seen = 0;
 	count = 0;
diff --git a/diff.h b/diff.h
index 9443dc1b00..bd96c8c434 100644
--- a/diff.h
+++ b/diff.h
@@ -495,6 +495,7 @@ void free_diffstat_info(struct diffstat_t *diffstat);
 int parse_long_opt(const char *opt, const char **argv,
 		   const char **optarg);
 
+int count_lines(const char *data, int size);
 int git_diff_basic_config(const char *var, const char *value, void *cb);
 int git_diff_heuristic_config(const char *var, const char *value, void *cb);
 void init_diff_ui_defaults(void);
-- 
2.27.0




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux