Mail Archives: djgpp-workers/1997/10/08/22:57:34
--Message-Boundary-1114
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7BIT
Content-description: Mail message body
gethostname() in 2.01 under w95 returns (for example)
"currieb ", which I beleive is not really any good. Can host
names have any spaces in them at all? Trailing spaces certainly don't
make any sence.
Here's a patch to cause gethostname() to strip trailing spaces from
the machine name when int 0x21, ax=0x5e00 succeeds (does not affect
HOSTNAME from the environment).
Bill
--
Leave others their otherness.
--Message-Boundary-1114
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7BIT
Content-description: Text from file 'gethostn.patch'
*** gethostn.c~ Thu Oct 9 15:25:00 1997
--- gethostn.c Thu Oct 9 15:33:04 1997
***************
*** 31,38 ****
}
else
{
! dosmemget (__tb, sizeof (dosbuf), dosbuf);
! h = dosbuf;
}
len = strlen (h);
--- 31,41 ----
}
else
{
! dosmemget (__tb, sizeof (dosbuf), dosbuf);
! h = dosbuf + strlen (dosbuf);
! while (h > dosbuf && h[-1] == ' ') h--;
! *h = 0;
! h = dosbuf;
}
len = strlen (h);
--Message-Boundary-1114--
- Raw text -