while (defined (my $line = <FILE>)) {
my $data = $line;
- # Kill any quoted , ; or "
- $data =~ s/'[";,]'/'X'/g;
+ # Kill any quoted , ; = or "
+ $data =~ s/'[";,=]'/'X'/g;
# Kill any quoted strings
$data =~ s,"([^\\\"]|\\.)*","XXX",g;
# Require spaces around assignment '=', compounds and '=='
# with the exception of virAssertCmpInt()
- while ($data =~ /[^!<>&|\-+*\/%\^'= ]=\+[^=]/ ||
- $data =~ /[^!<>&|\-+*\/%\^'=]=[^= \\\n]/ ||
- $data =~ /[\S]==/ ||
- ($data =~ /==[^\s,]/ && $data !~ /[\s]virAssertCmpInt\(/)) {
+ $data =~ s/(virAssertCmpInt\(.* ).?=,/$1op,/;
+ while ($data =~ /[^ ]\b[!<>&|\-+*\/%\^=]?=[^=]/ ||
+ $data =~ /=[^= \\\n]/) {
print "$file:$.: $line";
$ret = 1;
last;
if (virCommandRun(cmd, NULL) == 0) {
/* command was successfully run, check if the file was created */
- if (stat(vol->target.path, &st) >=0)
+ if (stat(vol->target.path, &st) >= 0)
filecreated = true;
}
}
*ndistances = max_node + 1;
- for (i = 0; i<= max_node; i++) {
+ for (i = 0; i <= max_node; i++) {
if (!virNumaNodeIsAvailable(node))
continue;
virDomainPtr dom = snapshot->domain;
VBOX_OBJECT_CHECK(dom->conn, int, -1);
- virDomainSnapshotDefPtr def= NULL;
+ virDomainSnapshotDefPtr def = NULL;
char *defXml = NULL;
vboxIID domiid = VBOX_IID_INITIALIZER;
nsresult rc;
&dhcpServer);
if (dhcpServer) {
ipdef->nranges = 1;
- if (VIR_ALLOC_N(ipdef->ranges, ipdef->nranges) >=0) {
+ if (VIR_ALLOC_N(ipdef->ranges, ipdef->nranges) >= 0) {
PRUnichar *ipAddressUtf16 = NULL;
PRUnichar *networkMaskUtf16 = NULL;
PRUnichar *fromIPAddressUtf16 = NULL;
}
ipdef->nhosts = 1;
- if (VIR_ALLOC_N(ipdef->hosts, ipdef->nhosts) >=0) {
+ if (VIR_ALLOC_N(ipdef->hosts, ipdef->nhosts) >= 0) {
if (VIR_STRDUP(ipdef->hosts[0].name, network->name) < 0) {
VIR_FREE(ipdef->hosts);
ipdef->nhosts = 0;
}
vm = vms->contents[0];
xen_vm_get_uuid(session, &uuid, vm);
- if (uuid!=NULL) {
+ if (uuid != NULL) {
ignore_value(virUUIDParse(uuid, raw_uuid));
domP = virGetDomain(conn, name, raw_uuid);
if (domP != NULL) {