mirror of
https://github.com/antirez/linenoise.git
synced 2025-11-16 04:24:48 +00:00
@@ -1318,7 +1318,7 @@ int linenoiseHistorySave(const char *filename) {
|
|||||||
fp = fopen(filename,"w");
|
fp = fopen(filename,"w");
|
||||||
umask(old_umask);
|
umask(old_umask);
|
||||||
if (fp == NULL) return -1;
|
if (fp == NULL) return -1;
|
||||||
chmod(filename,S_IRUSR|S_IWUSR);
|
fchmod(fileno(fp),S_IRUSR|S_IWUSR);
|
||||||
for (j = 0; j < history_len; j++)
|
for (j = 0; j < history_len; j++)
|
||||||
fprintf(fp,"%s\n",history[j]);
|
fprintf(fp,"%s\n",history[j]);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
|||||||
Reference in New Issue
Block a user