[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] sysinfo: delete unnecessary white space of sysinfo.

On 06/28/2011 07:47 PM, Minoru Usui wrote:
>> Maybe we should use c_isspace() instead of open-coding this.  And how is
>> backslash a space?
> I'll replace above block to c_isspace().
> BTW, I copied its block from virSkipSpaces().

Ah, that explains your original design choices.

> It seems meaningful virSkipSpaces() treats backslash as space,
> but I think backslash is not space generally.
> Is it OK that virSkipSpaces() treats backslash as space?

I would argue no - most clients of virSkipSpaces want to skip just
spaces, and only clients parsing xend output want to skip backslashes as
well.  I think it may be better to provide a new function for xend use,
and fix virSkipSpaces to only skip real spaces.

> Doesn't it need to rename something and define another virSkipSpaces()
> which doesn't treat backslash as space?

Exactly.  Maybe:

virSkipSpaces(const char **str) -> new behavior
virSkipSpaceAndBackslash(const char **str) -> existing behavior, but
used only by xen code

Eric Blake   eblake redhat com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]