Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

save & restore environment (Developers)

posted by boeckmann, Aachen, Germany, 08.03.2026, 22:23

> > > COMMAND.COM is from EDR DOS 20250427
> >
> > This is failing because it is not getting the key, it is getting the
> prefix
> > of the key.
> > ...
> > When it gets the key it doesn't check there's an equals after it, hence
> the
> > key will match any other variable that starts with it.
>
> Thanks!
>
> Maybe that was what the removed s++; line was for:
>
> to include the = (equal sign) in the key.

Yes, get_key does not check for '='. The following seems to fix it (includes the = as part of the key for deletion.


diff --git a/command/comint.c b/command/comint.c
index 5068153..2d785c1 100644
--- a/command/comint.c
+++ b/command/comint.c
@@ -1641,6 +1641,7 @@ GLOBAL VOID CDECL cmd_set( BYTE *s )
        }
 #endif
 
+   s++;                        /* skip over = (include in key name) */
    c = *s;                     /* Save Character               */
    *s = '\0';                  /* terminate keyword            */
    strupr( key );              /* make keyword upper case       */
@@ -1649,7 +1650,7 @@ GLOBAL VOID CDECL cmd_set( BYTE *s )
       crlfflg = YES;
       return;
    }
-   *s++ = c;
+   *s = c;    /* recover first character of value */
 
    if ( *s != 0 ) { /* Add the definition to the end*/
       /* of the environment if the new*/

 

Complete thread:

Back to the forum
Board view  Mix view
23231 Postings in 2189 Threads, 405 registered users (0 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum