Adding the command-line option --noread to treat any name

on the command line as a new file.  Patch by Hans Alves.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4754 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
Benno Schulenberg
2014-04-08 18:59:30 +00:00
parent d19be5aafa
commit db7064b8e6
4 changed files with 21 additions and 7 deletions

View File

@@ -328,10 +328,10 @@ void open_buffer(const char *filename, bool undoable)
if (new_buffer)
make_new_buffer();
/* If the filename isn't blank, open the file. Otherwise, treat it
* as a new file. */
rc = (filename[0] != '\0') ? open_file(filename, new_buffer, &f) :
-2;
/* If the filename isn't blank, and we are not in NOREAD_MODE,
* open the file. Otherwise, treat it as a new file. */
rc = (filename[0] != '\0' && !ISSET(NOREAD_MODE)) ?
open_file(filename, new_buffer, &f) : -2;
/* If we have a file, and we're loading into a new buffer, update
* the filename. */