1/* $FreeBSD: head/contrib/libreadline/display.c 157195 2006-03-27 23:53:05Z ache $ */ |
2/* display.c -- readline redisplay facility. */ 3 4/* Copyright (C) 1987-2005 Free Software Foundation, Inc. 5 6 This file is part of the GNU Readline Library, a library for 7 reading lines of text with interactive input and history editing. 8 9 The GNU Readline Library is free software; you can redistribute it --- 1969 unchanged lines hidden (view full) --- 1979 saved_invis_chars_first_line = saved_physical_chars = 0; 1980} 1981 1982char * 1983_rl_make_prompt_for_search (pchar) 1984 int pchar; 1985{ 1986 int len; |
1987 char *pmt, *p; |
1988 1989 rl_save_prompt (); 1990 |
1991 /* We've saved the prompt, and can do anything with the various prompt 1992 strings we need before they're restored. We want the unexpanded 1993 portion of the prompt string after any final newline. */ 1994 p = rl_prompt ? strrchr (rl_prompt, '\n') : 0; 1995 if (p == 0) |
1996 { 1997 len = (rl_prompt && *rl_prompt) ? strlen (rl_prompt) : 0; 1998 pmt = (char *)xmalloc (len + 2); 1999 if (len) 2000 strcpy (pmt, rl_prompt); 2001 pmt[len] = pchar; 2002 pmt[len+1] = '\0'; 2003 } 2004 else 2005 { |
2006 p++; 2007 len = strlen (p); |
2008 pmt = (char *)xmalloc (len + 2); 2009 if (len) |
2010 strcpy (pmt, p); |
2011 pmt[len] = pchar; 2012 pmt[len+1] = '\0'; |
2013 } |
2014 |
2015 /* will be overwritten by expand_prompt, called from rl_message */ |
2016 prompt_physical_chars = saved_physical_chars + 1; |
2017 return pmt; 2018} 2019 2020/* Quick redisplay hack when erasing characters at the end of the line. */ 2021void 2022_rl_erase_at_end_of_line (l) 2023 int l; 2024{ --- 358 unchanged lines hidden --- |