mirror of
https://github.com/rfivet/uemacs.git
synced 2024-09-27 07:55:54 -04:00
Add CRYPT mode to buffer when doing a set-encryption-key on a buffer where the mode is not set yet.
This commit is contained in:
parent
8aeb526a2a
commit
e3d7efda7f
5
file.c
5
file.c
@ -19,6 +19,7 @@
|
|||||||
#include "buffer.h"
|
#include "buffer.h"
|
||||||
#include "crypt.h"
|
#include "crypt.h"
|
||||||
#include "defines.h"
|
#include "defines.h"
|
||||||
|
#include "display.h"
|
||||||
#include "estruct.h"
|
#include "estruct.h"
|
||||||
#include "execute.h"
|
#include "execute.h"
|
||||||
#include "fileio.h"
|
#include "fileio.h"
|
||||||
@ -205,6 +206,10 @@ int set_encryption_key( int f, int n) {
|
|||||||
curbp->b_key[ sizeof( ekey_t) - 1] = '\0' ;
|
curbp->b_key[ sizeof( ekey_t) - 1] = '\0' ;
|
||||||
free( key) ;
|
free( key) ;
|
||||||
cryptbufferkey( curbp) ;
|
cryptbufferkey( curbp) ;
|
||||||
|
if( !(curbp->b_mode & MDCRYPT)) {
|
||||||
|
curbp->b_mode |= MDCRYPT ;
|
||||||
|
upmode() ;
|
||||||
|
}
|
||||||
|
|
||||||
mloutstr( "") ; /* clear the message line */
|
mloutstr( "") ; /* clear the message line */
|
||||||
return TRUE ;
|
return TRUE ;
|
||||||
|
Loading…
Reference in New Issue
Block a user