Handle setting zero length variable name

darcs-hash:20051207144849-ac50b-d919481d54ef80c68d5f4cc847d5c2370e94ddcc.gz
This commit is contained in:
axel 2005-12-08 00:48:49 +10:00
parent 8b4637e900
commit a46be4cadb

View file

@ -435,6 +435,13 @@ int builtin_set( wchar_t **argv )
{
dest = wcsdup(argv[woptind++]);
//fwprintf(stderr, L"Dest: %ls\n", dest);
if( !wcslen( dest ) )
{
free( dest );
sb_printf( sb_err, L"%ls: Variable name must not be zero\n", argv[0] );
return 1;
}
}
/* Parse values */