/* regexp.c -- The regexp command. */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2005,2007 Free Software Foundation, Inc.
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GRUB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
#include <grub/script_sh.h>
#include <regex.h>
GRUB_MOD_LICENSE ("GPLv3+");
{
N_("Variable names to update with matches."),
{ 0, 0, 0, 0, 0, 0 }
};
static grub_err_t
{
int i;
char ch;
char *p;
char *q;
unsigned long j;
auto void setvar (char *v, regmatch_t *m);
{
}
{
{
/* varname w/o index defaults to 1 */
grub_env_unset (varnames[i]);
else
}
else
{
if (q != p)
return grub_error (GRUB_ERR_BAD_ARGUMENT,
"invalid variable name format %s", varnames[i]);
grub_env_unset (p + 1);
else
}
if (err != GRUB_ERR_NONE)
return err;
}
return GRUB_ERR_NONE;
}
static grub_err_t
{
int ret;
grub_size_t s;
char *comperr;
if (argc != 2)
if (ret)
goto fail;
if (! matches)
goto fail;
if (!ret)
{
return err;
}
fail:
comperr = grub_malloc (s);
if (!comperr)
{
return grub_errno;
}
return err;
}
{
/* Setup GRUB script wildcard translator. */
}
{
}