Skip to content

Commit

Permalink
Encode if we have readline in workspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisJefferson committed Aug 21, 2018
1 parent 470fbe0 commit 6543fc1
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions src/saveload.c
Original file line number Diff line number Diff line change
Expand Up @@ -528,13 +528,24 @@ static void RemoveSaveIndex( Bag bag)
LINK_BAG(bag) = bag;
}


static Char * GetKernelDescription(void)
{
static Char SyKernelDescription[256];
strcpy(SyKernelDescription, SyKernelVersion);
if (SyUseReadline) {
strcat(SyKernelDescription, " with readline");
}
return SyKernelDescription;
}

static void WriteSaveHeader( void )
{
UInt i;
UInt globalcount = 0;

SaveCStr("GAP workspace");
SaveCStr(SyKernelVersion);
SaveCStr(GetKernelDescription());

#ifdef SYS_IS_64_BIT
SaveCStr("64 bit");
Expand Down Expand Up @@ -661,10 +672,11 @@ void LoadWorkspace( Char * fname )
if (strcmp (buf, "GAP workspace") == 0) {

LoadCStr(buf,256);
if (strcmp (buf, SyKernelVersion) != 0) {
Pr("This workspace is not compatible with GAP kernel (%s, present: %s).\n",
(long)buf, (long)SyKernelVersion);
SyExit(1);
if (strcmp(buf, GetKernelDescription()) != 0) {
Pr("This workspace is not compatible with GAP kernel (%s, present: "
"%s).\n",
(long)buf, (long)GetKernelDescription());
SyExit(1);
}

LoadCStr(buf,256);
Expand Down

0 comments on commit 6543fc1

Please sign in to comment.