1156
1156
lintwarn(_("`%s' is not a variable name, looking for file `%s=%s'"),
1162
// Assigning a string or typed regex
1164
if (check_special(arg) >= 0)
1165
fatal(_("cannot use gawk builtin `%s' as variable name"), arg);
1169
if (var != NULL && var->type == Node_func)
1170
fatal(_("cannot use function `%s' as variable name"), arg);
1173
cp2 = cp + strlen(cp) - 1; // end char
1174
if (! do_traditional
1175
&& cp[0] == '@' && cp[1] == '/' && *cp2 == '/') {
1177
size_t len = strlen(cp) - 3;
1179
ezalloc(cp2, char *, len + 1, "arg_assign");
1180
memcpy(cp2, cp + 2, len);
1182
it = make_typed_regex(cp2, len);
1183
// fall through to variable setup
1159
if (check_special(arg) >= 0)
1160
fatal(_("cannot use gawk builtin `%s' as variable name"), arg);
1164
if (var != NULL && var->type == Node_func)
1165
fatal(_("cannot use function `%s' as variable name"), arg);
1185
// string assignment
1168
1187
// POSIX disallows any newlines inside strings
1169
1188
// The scanner handles that for program files.
1191
1210
setlocale(LC_NUMERIC, locale);
1192
1211
#endif /* LC_NUMERIC */
1195
* since we are restoring the original text of ARGV later,
1196
* need to copy the variable name part if we don't want
1197
* name like v=abc instead of just v in var->vname
1200
cp2 = estrdup(arg, cp - arg); /* var name */
1202
var = variable(0, cp2, Node_var);
1203
if (var == NULL) /* error */
1204
final_exit(EXIT_FATAL);
1205
if (var->type == Node_var && var->var_update)
1207
lhs = get_lhs(var, false);
1210
/* check for set_FOO() routine */
1211
if (var->type == Node_var && var->var_assign)
1215
* since we are restoring the original text of ARGV later,
1216
* need to copy the variable name part if we don't want
1217
* name like v=abc instead of just v in var->vname
1220
cp2 = estrdup(arg, cp - arg); /* var name */
1222
var = variable(0, cp2, Node_var);
1223
if (var == NULL) /* error */
1224
final_exit(EXIT_FATAL);
1226
if (var->type == Node_var && var->var_update)
1228
lhs = get_lhs(var, false);
1231
/* check for set_FOO() routine */
1232
if (var->type == Node_var && var->var_assign)
1216
1237
*--cp = '='; /* restore original text of ARGV */
1217
1238
FNR = save_FNR;