Beispiel #1
0
int kill_to_end_of_line( void )
{
    int nd;
    int count = arg;
    bool merge = last_proc == kill_to_end_of_line;

    if( cur_exec != 0 && cur_exec->p_nargs > 0 )
        count = count * numeric_arg (1);

    do
    {
        arg = 1;
        nd = dot;
        end_of_line ();
        nd = dot - nd;
        if( nd <= 0 )
            nd = -1;
        if( !merge )
            replace_to_buf (-nd, kill_buffer_str);
        else
            append_to_buf (-nd, kill_buffer_str);
        merge = true;
        count--;
    }
    while( count > 0 );

    return 0;
}
void addToPassphrase(AppInfo *app, char c)
{
   int status = append_to_buf(&(app->buf), &(app->bufSize),
			      &(app->bufIndex), c);
   if (APPEND_FAILURE == status) {
      cleanUp(app);
      outOfMemory(app, __LINE__);
   }
   updateIndicators(app, 1);
}
void acceptAction(AppInfo *app)
{
   int status = append_to_buf(&(app->buf), &(app->bufSize),
			      &(app->bufIndex), '\0');
   if (APPEND_FAILURE == status) {
      cleanUp(app);
      outOfMemory(app, __LINE__);
   }
   fputs(app->buf, stdout);
   fputc('\n', stdout);
   exitApp(app, EXIT_STATUS_ACCEPT);
}