Lines Matching refs:string

127 get_history_event (string, caller_index, delimiting_quote)  in get_history_event()  argument
128 const char *string; in get_history_event()
152 if (string[i] != history_expansion_char)
165 if (string[i] == history_expansion_char)
174 if (string[i] == '-')
180 if (_rl_digit_p (string[i]))
183 for (which = 0; _rl_digit_p (string[i]); i++)
184 which = (which * 10) + _rl_digit_value (string[i]);
197 if (string[i] == '?')
204 for (local_index = i; (c = string[i]); i++)
214 _rl_adjust_point (string, i, &ps);
215 if ((v = _rl_get_char_len (string + i, &ps)) > 1)
225 string[i] == delimiting_quote)) ||
226 string[i] == '\n' ||
227 (substring_okay && string[i] == '?'))
233 strncpy (temp, string + local_index, which);
236 if (substring_okay && string[i] == '?')
305 hist_string_extract_single_quoted (string, sindex) in hist_string_extract_single_quoted() argument
306 char *string; in hist_string_extract_single_quoted()
311 for (i = *sindex; string[i] && string[i] != '\''; i++)
513 history_expand_internal (string, start, end_index_ptr, ret_string, current_line) in history_expand_internal() argument
514 char *string; in history_expand_internal()
536 if (member (string[i + 1], ":$*%^"))
545 else if (string[i + 1] == '#')
562 l = _rl_find_prev_mbchar (string, i, MB_FIND_ANY);
563 c = string[l];
570 if (i && (string[i - 1] == '\'' || string[i - 1] == '"'))
571 quoted_search_delimiter = string[i - 1];
573 event = get_history_event (string, &i, quoted_search_delimiter);
578 *ret_string = hist_error (string, start, i, EVENT_NOT_FOUND);
585 word_spec = get_history_word_specifier (string, event, &i);
592 *ret_string = hist_error (string, starting_index, i, BAD_WORD_SPEC);
605 while (string[i] == ':')
607 c = string[i + 1];
613 c = string[i + 1];
619 *ret_string = hist_error (string, i+1, i+2, BAD_MODIFIER);
690 if (i + 2 < (int)strlen (string))
695 _rl_adjust_point (string, i + 2, &ps);
696 if (_rl_get_char_len (string + i + 2, &ps) > 1)
699 delimiter = string[i + 2];
703 delimiter = string[i + 2];
710 t = get_subst_pattern (string, &i, delimiter, 0, &subst_lhs_len);
733 subst_rhs = get_subst_pattern (string, &i, delimiter, 1, &subst_rhs_len);
746 *ret_string = hist_error (string, starting_index, i, NO_PREV_SUBST);
756 *ret_string = hist_error (string, starting_index, i, SUBST_FAILED);
800 *ret_string = hist_error (string, starting_index, i, SUBST_FAILED);
883 char *string; local
926 string = (char *)xmalloc (l + 5);
928 string[0] = string[1] = history_expansion_char;
929 string[2] = ':';
930 string[3] = 's';
931 strlcpy (string + 4, hstring, l + 1);
940 string = hstring;
945 for (i = 0; string[i]; i++)
951 v = _rl_get_char_len (string + i, &ps);
960 cc = string[i + 1];
965 if (history_comment_char && string[i] == history_comment_char &&
966 (i == 0 || member (string[i - 1], history_word_delimiters)))
968 while (string[i])
972 else if (string[i] == history_expansion_char)
982 (*history_inhibit_expansion_function) (string, i))
989 else if (history_quotes_inhibit_expansion && string[i] == '\'')
993 hist_string_extract_single_quoted (string, &i);
995 else if (history_quotes_inhibit_expansion && string[i] == '\\')
1004 if (string[i] != history_expansion_char)
1007 *output = savestring (string);
1015 int tchar = string[i];
1036 c = string[++i];
1056 ADD_CHAR (string[i]);
1073 hist_string_extract_single_quoted (string, &i);
1077 strncpy (temp, string + quote, slen);
1083 ADD_CHAR (string[i]);
1088 if (i == 0 || member (string[i - 1], history_word_delimiters))
1091 strlcpy (temp, string + i, l - i + 1);
1097 ADD_CHAR (string[i]);
1101 cc = string[i + 1];
1108 ADD_CHAR (string[i]);
1132 r = history_expand_internal (string, i, &eindex, &temp, result);
1137 if (string != hstring)
1138 free (string);
1158 if (string != hstring)
1159 free (string);
1281 history_arg_extract (first, last, string) in history_arg_extract() argument
1283 const char *string;
1293 if ((list = history_tokenize (string)) == NULL)
1348 history_tokenize_internal (string, wind, indp) in history_tokenize_internal() argument
1349 const char *string; in history_tokenize_internal()
1363 for (i = result_index = size = 0, result = (char **)NULL; string[i]; )
1368 for (; string[i] && whitespace (string[i]); i++)
1370 if (string[i] == 0 || string[i] == history_comment_char)
1375 if (member (string[i], "()\n"))
1381 if (member (string[i], "<>;&|$"))
1383 int peek = string[i + 1];
1385 if (peek == string[i] && peek != '$')
1387 if (peek == '<' && string[i + 2] == '-')
1394 if ((peek == '&' && (string[i] == '>' || string[i] == '<')) ||
1395 ((peek == '>') && (string[i] == '&')) ||
1396 ((peek == '(') && (string[i] == '$')))
1402 if (string[i] != '$')
1411 if (member (string[i], HISTORY_QUOTE_CHARACTERS))
1412 delimiter = string[i++];
1414 for (; string[i]; i++)
1416 if (string[i] == '\\' && string[i + 1] == '\n')
1422 if (string[i] == '\\' && delimiter != '\'' &&
1423 (delimiter != '"' || member (string[i], slashify_in_quotes)))
1429 if (delimiter && string[i] == delimiter)
1435 if (!delimiter && (member (string[i], history_word_delimiters)))
1438 if (!delimiter && member (string[i], HISTORY_QUOTE_CHARACTERS))
1439 delimiter = string[i];
1453 strncpy (result[result_index], string + start, len);
1464 history_tokenize (string) in history_tokenize() argument
1465 const char *string; in history_tokenize()
1467 return (history_tokenize_internal (string, -1, (int *)NULL));