Bug 4436

Summary: Build failure if history file disabled
Product: Busybox Reporter: mr.nckx
Component: OtherAssignee: unassigned
Status: RESOLVED FIXED    
Severity: normal CC: busybox-cvs
Priority: P5    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: All   
Host: Target:
Build:

Description mr.nckx 2011-11-03 21:59:21 UTC
The latest git version of Busybox refuses to build if (at least) shell history is enabled but a history file is not.

In libbb/lineedit.c, cnt_history_in_file is accessed even if ENABLE_FEATURE_EDITING_SAVEHISTORY is disabled:

  libbb/lineedit.c: In function ‘remember_in_history’:
  libbb/lineedit.c:1523:47: error: ‘line_input_t’ has no member named ‘cnt_history_in_file’
  libbb/lineedit.c:1524:39: error: ‘line_input_t’ has no member named ‘cnt_history_in_file’
  make[1]: *** [libbb/lineedit.o] Error 1

The solution is to replace

  if (ENABLE_FEATURE_EDITING_SAVE_ON_EXIT && state->cnt_history_in_file)
    state->cnt_history_in_file--;

with

  # if ENABLE_FEATURE_EDITING_SAVEHISTORY
  if (ENABLE_FEATURE_EDITING_SAVE_ON_EXIT && state->cnt_history_in_file)
    state->cnt_history_in_file--;
  # endif

on line 1523 of libbb/lineedit.c.

I've just started learning git this morning; creating a patch, let alone one that would apply properly, is a bit too daunting at the moment.

   nckx
Comment 1 Denys Vlasenko 2011-11-04 00:09:41 UTC
Fixed in git. Thanks.