Ticket #4613: eta_check.patch

File eta_check.patch, 693 bytes (added by js216, 5 days ago)

Patch to check if eta_secs is too large to display as integer

  • src/filemanager/filegui.c

    diff --git a/src/filemanager/filegui.c b/src/filemanager/filegui.c
    index 5b76b649e..0cd2cf946 100644
    a b  
    6464#include <ctype.h> 
    6565#include <stdio.h> 
    6666#include <string.h> 
     67#include <limits.h> /* INT_MAX */ 
    6768#include <sys/types.h> 
    6869#include <sys/stat.h> 
    6970 
    file_eta_prepare_for_show (char *buffer, double eta_secs, gboolean always_show) 
    358359        eta_secs = 1.0; 
    359360    } 
    360361 
    361     file_frmt_time (_fmt_buff, eta_secs); 
     362    if (eta_secs >= INT_MAX) 
     363       strcpy (_fmt_buff, "--"); 
     364    else 
     365       file_frmt_time (_fmt_buff, eta_secs); 
     366 
    362367    g_snprintf (buffer, BUF_TINY, _("ETA %s"), _fmt_buff); 
    363368} 
    364369