Commit Diff
- Commit:
a0faec76c1ca1d5e829f04d65b45b8c9d032383a
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
- Message:
- important regression fix: do not truncate config files in /etc Tom Smyth found during testing that when editing config files via the "edit" ctl commands we would always truncate existing files in /etc. And thus always see an empty file to load an example for. Fix this by passing the correct mode to fopen(): a+ instead of w+ Committing right now to prevent data loss. People running nsh built from the previous commit 574d5c2d6a16ae5600d65fedc157d03e7fcfdd43 should update.
- Actions:
- Patch | Tree
--- ctl.c +++ ctl.c @@ -832,7 +832,7 @@ provide_example_config(char *filename) memset(tmpprompt, 0, sizeof(tmpprompt)); - f = fopen(filename, "w+"); + f = fopen(filename, "a+"); if (f == NULL) return;