mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
C code bug fixes
- fix to buildin.c to prevent compiler from optimizing it out - fix to realpath.c to handle case where 'path' is NULL - fix to emacs.c (I think from dgk) - fix to file.c (I think from gsf) - fix to tail.c (I think from gsf) - fix to code setting the malloc init hook (for vmalloc) - changed memcpy to memmove in several places in sfio because src and dst might overlap - fixes to macros like FILE_defined to fix header file issues - fixes to expr.h to handle macro definition issue
This commit is contained in:
parent
0b36868c8c
commit
e8b3274a65
17 changed files with 62 additions and 36 deletions
|
|
@ -28,7 +28,7 @@
|
|||
*/
|
||||
|
||||
static const char usage[] =
|
||||
"+[-?\n@(#)$Id: tail (AT&T Research) 2012-06-19 $\n]"
|
||||
"+[-?\n@(#)$Id: tail (AT&T Research) 2012-10-10 $\n]"
|
||||
USAGE_LICENSE
|
||||
"[+NAME?tail - output trailing portion of one or more files ]"
|
||||
"[+DESCRIPTION?\btail\b copies one or more input files to standard output "
|
||||
|
|
@ -424,7 +424,7 @@ b_tail(int argc, char** argv, Shbltin_t* context)
|
|||
Tail_t* files;
|
||||
Tv_t tv;
|
||||
|
||||
cmdinit(argc, argv, context, ERROR_CATALOG, 0);
|
||||
cmdinit(argc, argv, context, ERROR_CATALOG, ERROR_NOTIFY);
|
||||
for (;;)
|
||||
{
|
||||
switch (n = optget(argv, usage))
|
||||
|
|
@ -639,7 +639,7 @@ b_tail(int argc, char** argv, Shbltin_t* context)
|
|||
{
|
||||
if (n)
|
||||
n = 0;
|
||||
else if (sh_checksig(context) || tvsleep(&tv, NiL))
|
||||
else if (sh_checksig(context) || tvsleep(&tv, NiL) && sh_checksig(context))
|
||||
{
|
||||
error_info.errors++;
|
||||
break;
|
||||
|
|
@ -686,11 +686,13 @@ b_tail(int argc, char** argv, Shbltin_t* context)
|
|||
{
|
||||
i = 3;
|
||||
while (--i && stat(fp->name, &st))
|
||||
if (sh_checksig(context) || tvsleep(&tv, NiL))
|
||||
if (sh_checksig(context))
|
||||
{
|
||||
error_info.errors++;
|
||||
goto done;
|
||||
}
|
||||
else
|
||||
tvsleep(&tv, NiL);
|
||||
if (i && (fp->dev != st.st_dev || fp->ino != st.st_ino) && !init(fp, 0, 0, flags, &format))
|
||||
{
|
||||
if (!(flags & SILENT))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue