Ticket #1530: view.c.diff

File view.c.diff, 872 bytes (added by dmartina, 13 years ago)

Patch to build format string in runtime, not preprocessor.

  • src/view.c

    diff -ur mc.git/src/view.c mc.src/src/view.c
    old new  
    30053005static void 
    30063006view_moveto_addr_cmd (WView *view) 
    30073007{ 
    3008     char *line, *error, prompt[BUF_SMALL]; 
     3008    char *line, *error, prompt_format[BUF_SMALL], prompt[BUF_SMALL]; 
    30093009    offset_type addr; 
    30103010 
    3011     g_snprintf (prompt, sizeof (prompt), 
    3012                 _(" The current address is 0x%08"OFFSETTYPE_PRIX".\n" 
    3013                   " Enter the new address:"), view->hex_cursor); 
     3011    g_snprintf (prompt_format, sizeof (prompt_format), 
     3012                _(" The current address is %s.\n" 
     3013                  " Enter the new address:"), "0x%08"OFFSETTYPE_PRIX""); 
     3014 
     3015    g_snprintf (prompt, sizeof (prompt), prompt_format, view->hex_cursor); 
    30143016 
    30153017    line = input_dialog (_(" Goto Address "), prompt, MC_HISTORY_VIEW_GOTO_ADDR, ""); 
    30163018    if (line != NULL) {