mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
virsh: Add helper to avoid the strcase check for virsh-*.c
* tools/virsh.c: New macro vshStrcasecmp
* tools/virsh-domain-monitor.c: Use vshStrcasecmp instead of
strcasecmp
* tools/virsh-snapshot.c: Likewise
* cfg.mk: Only avoid doing strcase checking for virsh.c
This commit is contained in:
@@ -357,6 +357,9 @@ static void vshDebug(vshControl *ctl, int level, const char *format, ...)
|
||||
/* XXX: add batch support */
|
||||
#define vshPrint(_ctl, ...) vshPrintExtra(NULL, __VA_ARGS__)
|
||||
|
||||
/* User visible sort, so we want locale-specific case comparison. */
|
||||
#define vshStrcasecmp(S1, S2) strcasecmp(S1, S2)
|
||||
|
||||
static int vshDomainState(vshControl *ctl, virDomainPtr dom, int *reason);
|
||||
static const char *vshDomainStateToString(int state);
|
||||
static const char *vshDomainStateReasonToString(int state, int reason);
|
||||
@@ -462,8 +465,7 @@ vshNameSorter(const void *a, const void *b)
|
||||
const char **sa = (const char**)a;
|
||||
const char **sb = (const char**)b;
|
||||
|
||||
/* User visible sort, so we want locale-specific case comparison. */
|
||||
return strcasecmp(*sa, *sb);
|
||||
return vshStrcasecmp(*sa, *sb);
|
||||
}
|
||||
|
||||
static double
|
||||
|
||||
Reference in New Issue
Block a user