display.c (157188) | display.c (157195) |
---|---|
1/* $FreeBSD: head/contrib/libreadline/display.c 157188 2006-03-27 23:11:32Z ache $ */ | 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; | 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; | 1987 char *pmt, *p; |
1988 1989 rl_save_prompt (); 1990 | 1988 1989 rl_save_prompt (); 1990 |
1991 if (saved_local_prompt == 0) | 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) |
1992 { 1993 len = (rl_prompt && *rl_prompt) ? strlen (rl_prompt) : 0; 1994 pmt = (char *)xmalloc (len + 2); 1995 if (len) 1996 strcpy (pmt, rl_prompt); 1997 pmt[len] = pchar; 1998 pmt[len+1] = '\0'; 1999 } 2000 else 2001 { | 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 { |
2002 len = *saved_local_prompt ? strlen (saved_local_prompt) : 0; | 2006 p++; 2007 len = strlen (p); |
2003 pmt = (char *)xmalloc (len + 2); 2004 if (len) | 2008 pmt = (char *)xmalloc (len + 2); 2009 if (len) |
2005 strcpy (pmt, saved_local_prompt); | 2010 strcpy (pmt, p); |
2006 pmt[len] = pchar; 2007 pmt[len+1] = '\0'; | 2011 pmt[len] = pchar; 2012 pmt[len+1] = '\0'; |
2008 local_prompt = savestring (pmt); 2009 prompt_last_invisible = saved_last_invisible; 2010 prompt_visible_length = saved_visible_length + 1; 2011 } | 2013 } |
2012 | 2014 |
2015 /* will be overwritten by expand_prompt, called from rl_message */ |
|
2013 prompt_physical_chars = saved_physical_chars + 1; | 2016 prompt_physical_chars = saved_physical_chars + 1; |
2014 | |
2015 return pmt; 2016} 2017 2018/* Quick redisplay hack when erasing characters at the end of the line. */ 2019void 2020_rl_erase_at_end_of_line (l) 2021 int l; 2022{ --- 358 unchanged lines hidden --- | 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 --- |