Bug 4436 - Build failure if history file disabled
Summary: Build failure if history file disabled
Status: RESOLVED FIXED
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: PC All
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-03 21:59 UTC by mr.nckx
Modified: 2011-11-04 00:09 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.