          char *expansion;
               int result;
     
               result = history_expand (line, &amp;expansion);
               if (result)
                 fprintf (stderr, "%s\n", expansion);
     
               if (result &lt; 0 || result == 2)
                 {
                   free (expansion);
                   continue;
                 }
     
               add_history (expansion);
               strncpy (line, expansion, sizeof (line) - 1);
               free (expansion);
         