Skip to content

Commit

Permalink
Remove -i, which sets first file GAP reads. Was broken for years.
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisJefferson committed Apr 19, 2017
1 parent 5b93be2 commit 2cac320
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 34 deletions.
6 changes: 0 additions & 6 deletions doc/ref/run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,6 @@ tells &GAP; to print a summary of all available options (<C>-h</C> is mnemonic
for <Q>help</Q>). &GAP; exits after printing the summary, all other options
are ignored.
</Item>
<Mark><Index Key="-i"><C>-i</C></Index>
<C>-i </C><A>filename</A></Mark>
<Item>
changes the name of the init file from the default <F>init.g</F> to
<A>filename</A>. (Usually not needed.)
</Item>
<Mark><Index Key="-K"><C>-K</C></Index>
<C>-K </C><A>memory</A></Mark>
<Item>
Expand Down
1 change: 0 additions & 1 deletion hpcgap/lib/system.g
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ BIND_GLOBAL( "GAPInfo", AtomicRecord(rec(
rec( short:= "X", default := false, help := ["enable/disable CRC checking for compiled modules"] ),
rec( short:= "T", default := false, help := ["disable/enable break loop"] ),
rec( long := "quitonbreak", default := false, help := ["quit GAP with non-zero return value instead of entering break loop"]),
rec( short:= "i", default := "", arg := "<file>", help := [ "change the name of the init file"] ),
,
rec( short:= "L", default := "", arg := "<file>", help := [ "restore a saved workspace"] ),
rec( short:= "R", default := false, help := ["prevent restoring of workspace (ignoring -L)"] ),
Expand Down
8 changes: 4 additions & 4 deletions hpcgap/src/gap.c
Original file line number Diff line number Diff line change
Expand Up @@ -3627,12 +3627,12 @@ void InitializeGap (
this now actually runs the GAP session, we only get
past here when we're about to exit.
*/
if ( SySystemInitFile[0] ) {
if ( SyLoadSystemInitFile ) {
TRY_READ {
if ( READ_GAP_ROOT(SySystemInitFile) == 0 ) {
if ( READ_GAP_ROOT("lib/init.g") == 0 ) {
/* if ( ! SyQuiet ) { */
Pr( "gap: hmm, I cannot find '%s' maybe",
(Int)SySystemInitFile, 0L );
Pr( "gap: hmm, I cannot find 'lib/init.g' maybe",
0L, 0L );
Pr( " use option '-l <gaproot>'?\n If you ran the GAP"
" binary directly, try running the 'gap.sh' or 'gap.bat'"
" script instead.", 0L, 0L );
Expand Down
11 changes: 4 additions & 7 deletions hpcgap/src/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,9 +414,9 @@ Int SyStorMin;

/****************************************************************************
**
*V SySystemInitFile . . . . . . . . . . . name of the system "init.g" file
*V SyLoadSystemInitFile . . . . . . should GAP load 'lib/init.g' at startup
*/
Char SySystemInitFile[GAP_PATH_MAX];
Int SyLoadSystemInitFile = 1;


/****************************************************************************
Expand Down Expand Up @@ -1762,7 +1762,6 @@ struct optInfo options[] = {
{ 'e', "", toggle, &SyCTRD, 0 }, /* kernel */
{ 'f', "", forceLineEditing, (void *)2, 0 }, /* probably library now */
{ 'E', "", toggle, &SyUseReadline, 0 }, /* kernel */
{ 'i', "", storeString, SySystemInitFile, 1}, /* kernel */
{ 'l', "roots", setGapRootPath, 0, 1}, /* kernel */
{ 'm', "", storeMemory2, &SyStorMin, 1 }, /* kernel */
{ 'r', "", toggle, &IgnoreGapRC, 0 }, /* kernel */
Expand Down Expand Up @@ -1903,8 +1902,6 @@ void InitSystem (

SyInstallAnswerIntr();

SySystemInitFile[0] = '\0';
strxcpy( SySystemInitFile, "lib/init.g", sizeof(SySystemInitFile) );
#if SYS_IS_CYGWIN32
SySetGapRootPath( SyWindowsPath );
#elif defined(SYS_DEFAULT_PATHS)
Expand Down Expand Up @@ -2027,9 +2024,9 @@ void InitSystem (
if ( ptr != 0 ) free( ptr ); */
}

/* try to find 'LIBNAME/init.g' to read it upon initialization */
/* should GAP load 'init/lib.g' on initialization */
if ( SyCompilePlease || SyRestoring ) {
SySystemInitFile[0] = 0;
SyLoadSystemInitFile = 0;
}

/* the compiler will *not* read in the .gaprc file
Expand Down
4 changes: 2 additions & 2 deletions hpcgap/src/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -496,9 +496,9 @@ extern Int SyStorMin;

/****************************************************************************
**
*V SySystemInitFile . . . . . . . . . . . name of the system "init.g" file
*V SyLoadSystemInitFile . . . . . . should GAP load 'lib/init.g' at startup
*/
extern Char SySystemInitFile[GAP_PATH_MAX];
extern Int SyLoadSystemInitFile;


/****************************************************************************
Expand Down
1 change: 0 additions & 1 deletion lib/system.g
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ BIND_GLOBAL( "GAPInfo", rec(
rec( short:= "X", default := false, help := ["enable/disable CRC checking for compiled modules"] ),
rec( short:= "T", default := false, help := ["disable/enable break loop"] ),
rec( long := "quitonbreak", default := false, help := ["quit GAP with non-zero return value instead of entering break loop"]),
rec( short:= "i", default := "", arg := "<file>", help := [ "change the name of the init file"] ),
,
rec( short:= "L", default := "", arg := "<file>", help := [ "restore a saved workspace"] ),
rec( short:= "R", default := false, help := ["prevent restoring of workspace (ignoring -L)"] ),
Expand Down
8 changes: 4 additions & 4 deletions src/gap.c
Original file line number Diff line number Diff line change
Expand Up @@ -3626,12 +3626,12 @@ void InitializeGap (
this now actually runs the GAP session, we only get
past here when we're about to exit.
*/
if ( SySystemInitFile[0] ) {
if ( SyLoadSystemInitFile ) {
TRY_READ {
if ( READ_GAP_ROOT(SySystemInitFile) == 0 ) {
if ( READ_GAP_ROOT("lib/init.g") == 0 ) {
/* if ( ! SyQuiet ) { */
Pr( "gap: hmm, I cannot find '%s' maybe",
(Int)SySystemInitFile, 0L );
Pr( "gap: hmm, I cannot find 'lib/init.g' maybe",
0L, 0L );
Pr( " use option '-l <gaproot>'?\n If you ran the GAP"
" binary directly, try running the 'gap.sh' or 'gap.bat'"
" script instead.", 0L, 0L );
Expand Down
11 changes: 4 additions & 7 deletions src/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,9 @@ Int SyStorMin;

/****************************************************************************
**
*V SySystemInitFile . . . . . . . . . . . name of the system "init.g" file
*V SyLoadSystemInitFile . . . . . . should GAP load 'lib/init.g' at startup
*/
Char SySystemInitFile[GAP_PATH_MAX];
Int SyLoadSystemInitFile = 1;


/****************************************************************************
Expand Down Expand Up @@ -1717,7 +1717,6 @@ struct optInfo options[] = {
{ 'e', "", toggle, &SyCTRD, 0 }, /* kernel */
{ 'f', "", forceLineEditing, (void *)2, 0 }, /* probably library now */
{ 'E', "", toggle, &SyUseReadline, 0 }, /* kernel */
{ 'i', "", storeString, SySystemInitFile, 1}, /* kernel */
{ 'l', "roots", setGapRootPath, 0, 1}, /* kernel */
{ 'm', "", storeMemory2, &SyStorMin, 1 }, /* kernel */
{ 'r', "", toggle, &IgnoreGapRC, 0 }, /* kernel */
Expand Down Expand Up @@ -1858,8 +1857,6 @@ void InitSystem (

SyInstallAnswerIntr();

SySystemInitFile[0] = '\0';
strxcpy( SySystemInitFile, "lib/init.g", sizeof(SySystemInitFile) );
#if SYS_IS_CYGWIN32
SySetGapRootPath( SyWindowsPath );
#elif defined(SYS_DEFAULT_PATHS)
Expand Down Expand Up @@ -1982,9 +1979,9 @@ void InitSystem (
if ( ptr != 0 ) free( ptr ); */
}

/* try to find 'LIBNAME/init.g' to read it upon initialization */
/* should GAP load 'init/lib.g' on initialization */
if ( SyCompilePlease || SyRestoring ) {
SySystemInitFile[0] = 0;
SyLoadSystemInitFile = 0;
}

/* the compiler will *not* read in the .gaprc file
Expand Down
4 changes: 2 additions & 2 deletions src/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -496,9 +496,9 @@ extern Int SyStorMin;

/****************************************************************************
**
*V SySystemInitFile . . . . . . . . . . . name of the system "init.g" file
*V SyLoadSystemInitFile . . . . . . should GAP load 'lib/init.g' at startup
*/
extern Char SySystemInitFile[GAP_PATH_MAX];
extern Int SyLoadSystemInitFile;


/****************************************************************************
Expand Down

0 comments on commit 2cac320

Please sign in to comment.