minishell
Minishell Project for École 42
|
Functions for checking the syntax of quotes in the input string. More...
#include "minishell.h"
Functions | |
int | get_end_quote (const char *input, char c) |
Find the index of the end of a quoted part in a string. | |
bool | check_quote_syntax (const char *input) |
Check the syntax of quotes in the input string. | |
Functions for checking the syntax of quotes in the input string.
bool check_quote_syntax | ( | const char * | input | ) |
Check the syntax of quotes in the input string.
Checks if the syntax of quoted parts (single or double quotes) in the input string is valid. Opening and closing quotes need to be correctly matched. Handles escape characters. If all quoted parts are correct, return true, else return false.
input | The string to be checked. |
int get_end_quote | ( | const char * | input, |
char | c | ||
) |
Find the index of the end of a quoted part in a string.
Looks for the end(matching quote) of a quoted part in the input string. The matching quote is given as an argument to the function. If the matching quote is found and is not escaped, its index is returned. Else the entire length of the input string is returned.
input | The input string. |
c | The character representing the matching closing quote. |