diff options
author | Jakob Kaivo <jkk@ung.org> | 2022-04-18 20:10:23 -0400 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2022-04-18 20:10:23 -0400 |
commit | 42ae813b3ec2d6faf123083e4a74172347632c8f (patch) | |
tree | defc4ca7c3b5b426136f354a8e4d13d22a654831 | |
parent | 3928fcc1c69c64279361ab7a3c2d7f025f697aaa (diff) |
add path to struct more_file
-rw-r--r-- | io.c | 2 | ||||
-rw-r--r-- | more.h | 1 |
2 files changed, 3 insertions, 0 deletions
@@ -62,6 +62,7 @@ struct more_file more_open(const char *path) fstat(fileno(mf.f), &st); mf.nbytes = st.st_size; } + mf.path = strdup(path); return mf; } @@ -78,4 +79,5 @@ void more_close(struct more_file *mf) free(mf->tlines); free(mf->buf); + free(mf->path); } @@ -12,6 +12,7 @@ struct more_file { size_t *bytepos; char *buf; size_t nbuf; + char *path; }; struct more_file more_open(const char *path); |