>>>>> "AS" == Armin Schindler <[EMAIL PROTECTED]> writes:

  AS> Hi, I'm not sure if I'm the only one having a problem with the
  AS> cli history written to and read back from history file.  The
  AS> lines written are encoded like

  AS> set\134040verbose\1340405\012

No you're not, I refer to it in #85.

  AS> but when read back, it is not decoded and when using <cursor-up>
  AS> the line like above is shown.  I noticed in corelib/openpbx.c
  AS> that the function opbx_el_read_history() does not use the
  AS> provided history-H_LOAD mechanism.  Anybody know why?

  AS> When I change that function to use H_LOAD (see patch below) it
  AS> works perfectly for me.

  AS> Any ideas?  If there are no objections, I will add this patch to
  AS> trunk.

  AS> Armin


  AS> diff -ur OpenPBX.orig/corelib/openpbx.c
  AS> OpenPBX/corelib/openpbx.c --- OpenPBX.orig/corelib/openpbx.c
  AS> 2005-12-11 19:26:58.330325502 +0100 +++
  AS> OpenPBX/corelib/openpbx.c 2005-12-11 20:17:21.298651968 +0100 @@
  AS> -1622,28 +1622,12 @@
 
  AS>  static int opbx_el_read_history(char *filename) { - char
  AS> buf[256]; - FILE *f; - int ret = -1; + HistEvent ev;
 
  AS>   if (el_hist == NULL || el == NULL) opbx_el_initialize();
 
  AS> - if ((f = fopen(filename, "r")) == NULL) - return ret; - -
  AS> while (!feof(f)) { - fgets(buf, sizeof(buf), f); - if
  AS> (!strcmp(buf, "_HiStOrY_V2_\n")) - continue; - if
  AS> (opbx_all_zeros(buf)) - continue; - if ((ret =
  AS> opbx_el_add_history(buf)) == -1) - break; - } - fclose(f); - -
  AS> return ret; + return (history(el_hist, &ev, H_LOAD, filename));
  AS> }
 
  AS>  static void opbx_remotecontrol(char * data)

  AS> _______________________________________________ Openpbx-dev
  AS> mailing list [email protected]
  AS> http://lists.openpbx.org/mailman/listinfo/openpbx-dev
_______________________________________________
Openpbx-dev mailing list
[email protected]
http://lists.openpbx.org/mailman/listinfo/openpbx-dev

Reply via email to