"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/file.cpp" between
bed-3.0.3.src.tar.xz and bed-3.1.0.src.tar.xz

About: bed is an adjustable data format binary editor.

file.cpp  (bed-3.0.3.src.tar.xz):file.cpp  (bed-3.1.0.src.tar.xz)
skipping to change at line 27 skipping to change at line 27
/* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/* Fri Dec 8 22:14:27 2000 */ /* Fri Dec 8 22:14:27 2000 */
#ifndef HAVE_SETENV #ifndef HAVE_SETENV
#include "setenv.h" #include "setenv.h"
#endif #endif
#include "desturbe.h" #include "desturbe.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <ctype.h> #include <ctype.h>
#include <signal.h> #include <signal.h>
#include <string.h>
#ifndef HAVE_STPCPY
#include <algorithm>
#endif
#ifdef HAVE_TERMIOS_H #ifdef HAVE_TERMIOS_H
#include <termios.h> #include <termios.h>
#endif #endif
#include <unistd.h> #include <unistd.h>
#include "editor.h" #include "editor.h"
#include "main.h" #include "main.h"
#include "system.h" #include "system.h"
#include "screen.h" #include "screen.h"
#include "inout.h" #include "inout.h"
#include "screenpart.h" #include "screenpart.h"
skipping to change at line 682 skipping to change at line 686
#undef ADDNEWLINE #undef ADDNEWLINE
#define ADDNEWLINE flen+=addnltoar(formbuf+flen); #define ADDNEWLINE flen+=addnltoar(formbuf+flen);
/* /*
#undef ADDNEWLINE #undef ADDNEWLINE
#define ADDNEWLINE formbuf[flen++]=0x0D; formbuf[flen++]=0x0A; #define ADDNEWLINE formbuf[flen++]=0x0D; formbuf[flen++]=0x0A;
*/ */
#if defined(__MINGW32__)&&!defined(SIGTSTP)
void kill(pid_t,int) {}
#endif
ssize_t Editor::saveshownname(const char *ant) { ssize_t Editor::saveshownname(const char *ant) {
if(selectpos== OFFTYPEINVALID) { if(selectpos== OFFTYPEINVALID) {
message("No selection"); message("No selection");
return -1; return -1;
} }
FILEHANDLE handle; FILEHANDLE handle;
memorize(); memorize();
#ifdef Windows //#ifdef Windows
#ifdef __CYGWIN__
char namebuf[BEDSMAXPATH]; char namebuf[BEDSMAXPATH];
winpath(ant,namebuf); winpath(ant,namebuf);
#else #else
const char *namebuf=ant; const char *namebuf=ant;
#endif #endif
if((handle=openfile(namebuf))==MY_INVALID_HANDLE_VALUE) { if((handle=openfile(namebuf))==MY_INVALID_HANDLE_VALUE) {
return -2; return -2;
} }
INCDEST(); INCDEST();
ScreenPart *datashown=parts[mode]; ScreenPart *datashown=parts[mode];
skipping to change at line 848 skipping to change at line 857
BEDS_SIZE_T readfromfile(FILEHANDLE input,char *buf,BEDS_SIZE_T nr) ; BEDS_SIZE_T readfromfile(FILEHANDLE input,char *buf,BEDS_SIZE_T nr) ;
int Editor::readshownname(const char *filename) { int Editor::readshownname(const char *filename) {
if(searchdontedit()) if(searchdontedit())
return -1; return -1;
FILEHANDLE handle; FILEHANDLE handle;
int ret=0; int ret=0;
memorize(); memorize();
#if defined(Windows) //#if defined(Windows)
#ifdef __CYGWIN__
char ant[BEDSMAXPATH]; char ant[BEDSMAXPATH];
winpath(filename,ant); winpath(filename,ant);
#else #else
const char * const ant=filename; const char * const ant=filename;
#endif #endif
if((handle=openreading(ant))==MY_INVALID_HANDLE_VALUE) { if((handle=openreading(ant))==MY_INVALID_HANDLE_VALUE) {
message("Can't open %s for reading",ant); message("Can't open %s for reading",ant);
return -1; return -1;
} }
skipping to change at line 993 skipping to change at line 1004
return; return;
} }
if(writetofile(soutf,reinterpret_cast<char *>(&Editor::defaultsearch),siz eof(Editor::defaultsearch))<0) if(writetofile(soutf,reinterpret_cast<char *>(&Editor::defaultsearch),siz eof(Editor::defaultsearch))<0)
fprintf(stderr,"Write to %s failed\n",bedrcbin); fprintf(stderr,"Write to %s failed\n",bedrcbin);
closefilehandle(soutf) ; closefilehandle(soutf) ;
}; };
int readsearchgegs(void) { int readsearchgegs(void) {
if(bedrcbin[0]!=FILENAMESEP[0]) { if(bedrcbin[0]!=FILENAMESEP[0]) {
#if defined(_WIN32) && !defined(DEFAULTBEDRCBIN) #if defined(_WIN32) && !defined(DEFAULTBEDRCBIN)
#ifndef BEDRCBINFILE #ifndef BEDRCBINFILE
const auto BEDRCBINFILE =R"(bedrc-bin)"; const char BEDRCBINFILE[]=R"(bedrc-bin)";
#endif #endif
// SHGetFolderPathA( NULL, CSIDL_APPDATA ,NULL,SHGFP_TYPE_CURRENT , bedrcbin ); // SHGetFolderPathA( NULL, CSIDL_APPDATA ,NULL,SHGFP_TYPE_CURRENT , bedrcbin );
SHGetFolderPathA( NULL, CSIDL_APPDATA ,NULL,0 , bedrcbin); SHGetFolderPathA( NULL, CSIDL_APPDATA ,NULL,0 , bedrcbin);
bedrcbinlen=strlen(bedrcbin); bedrcbinlen=strlen(bedrcbin);
bedrcbin[bedrcbinlen++]='\\'; bedrcbin[bedrcbinlen++]='\\';
#ifdef HAVE_STPCPY
const char * const endstr=stpcpy(bedrcbin+ bedrcbinlen, BEDRCBINFILE); const char * const endstr=stpcpy(bedrcbin+ bedrcbinlen, BEDRCBINFILE);
#else
const char * const endstr=std::copy(std::begin(BEDRCBINFILE),std::end(BED
RCBINFILE),bedrcbin+ bedrcbinlen);
#endif
bedrcbinlen=endstr-bedrcbin; bedrcbinlen=endstr-bedrcbin;
#else #else
expandfilename(bedrcbin,DEFAULTBEDRCBIN); expandfilename(bedrcbin,DEFAULTBEDRCBIN);
bedrcbinlen=strlen(bedrcbin); bedrcbinlen=strlen(bedrcbin);
#endif #endif
} }
FILEHANDLE sinf=openreading(bedrcbin); FILEHANDLE sinf=openreading(bedrcbin);
if(sinf== MY_INVALID_HANDLE_VALUE) { if(sinf== MY_INVALID_HANDLE_VALUE) {
#ifndef NDEBUG #ifndef NDEBUG
fprintf(stderr,"Can't open %s for reading\n",bedrcbin); fprintf(stderr,"Can't open %s for reading\n",bedrcbin);
 End of changes. 7 change blocks. 
3 lines changed or deleted 19 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)