Changeset 1913

Show
Ignore:
Timestamp:
02/24/09 22:06:39 (3 years ago)
Author:
mwhitworth
Message:

Save off the buffer before we process the line, so history is saved.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • Whitix/trunk/user/burn/main.c

    r1830 r1913  
    554554        while (1) 
    555555    { 
     556        char* save; 
     557         
    556558        strcpy(promptPrint, currPath); 
    557559        strcat(promptPrint, prompt); 
    558560                 
    559                 buffer=ConsReadLine(&context, promptPrint, promptColor); 
     561                buffer = ConsReadLine(&context, promptPrint, promptColor); 
    560562                 
    561563                if (!buffer) 
    562564                        break; 
    563565                 
     566                save = strdup(buffer); /* Better way? */ 
     567                 
    564568                ProcessLine(buffer); 
    565                 ConsAddHistory(&context, buffer); 
     569                ConsAddHistory(&context, save); 
     570                free(save); 
    566571        } 
    567572