Try to fix the failing new StringFileTest on HP-UX

It seems that
while(i=file.get(), file)
iterates one character too much on HP-UX, let's see whether
while(file.get(c))
works, at least this is given as example on http://h30097.www3.hp.com/cplus/ifstream_3c__std.htm

Alex
This commit is contained in:
Alexander Neundorf 2009-09-06 13:24:56 -04:00
parent f5bcc82b13
commit 21179a2ade
1 changed files with 2 additions and 2 deletions

View File

@ -301,8 +301,8 @@ bool cmFileCommand::HandleReadCommand(std::vector<std::string> const& args)
if (hexOutputArg.IsEnabled()) if (hexOutputArg.IsEnabled())
{ {
// Convert part of the file into hex code // Convert part of the file into hex code
int c; char c;
while((sizeLimit != 0) && (c = file.get(), file)) while((sizeLimit != 0) && (file.get(c)))
{ {
char hex[4]; char hex[4];
sprintf(hex, "%.2x", c&0xff); sprintf(hex, "%.2x", c&0xff);