From 62d3238403377f61cd44c1c54e88d252f3e10726 Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Fri, 18 Mar 2011 14:50:10 -0500 Subject: [PATCH] const correctness --- linenoise.c | 4 ++-- linenoise.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/linenoise.c b/linenoise.c index b4fb56f..21f7a1e 100644 --- a/linenoise.c +++ b/linenoise.c @@ -1084,7 +1084,7 @@ int linenoiseHistorySetMaxLen(int len) { /* Save the history in the specified file. On success 0 is returned * otherwise -1 is returned. */ -int linenoiseHistorySave(char *filename) { +int linenoiseHistorySave(const char *filename) { FILE *fp = fopen(filename,"w"); int j; @@ -1119,7 +1119,7 @@ int linenoiseHistorySave(char *filename) { * * If the file exists and the operation succeeded 0 is returned, otherwise * on error -1 is returned. */ -int linenoiseHistoryLoad(char *filename) { +int linenoiseHistoryLoad(const char *filename) { FILE *fp = fopen(filename,"r"); char buf[LINENOISE_MAX_LINE]; diff --git a/linenoise.h b/linenoise.h index 1efa12f..bcd6fbd 100644 --- a/linenoise.h +++ b/linenoise.h @@ -51,8 +51,8 @@ void linenoiseAddCompletion(linenoiseCompletions *, const char *); char *linenoise(const char *prompt); int linenoiseHistoryAdd(const char *line); int linenoiseHistorySetMaxLen(int len); -int linenoiseHistorySave(char *filename); -int linenoiseHistoryLoad(char *filename); +int linenoiseHistorySave(const char *filename); +int linenoiseHistoryLoad(const char *filename); char **linenoiseHistory(int *len); #endif /* __LINENOISE_H */ -- 2.44.0