From 525ddb9ffcfbc77661e6532d28d6c91f08eba93e Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 22 Jun 2012 16:02:56 +0000 Subject: (compare_pkgs,compare) style: indent after last changes --- URPM.xs | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) (limited to 'URPM.xs') diff --git a/URPM.xs b/URPM.xs index e8ec8c3..34d325d 100644 --- a/URPM.xs +++ b/URPM.xs @@ -1639,7 +1639,7 @@ Pkg_compare_pkg(lpkg, rpkg) } compare = compare_evrs(lepoch, lversion, lrelease, repoch, rversion, rrelease); // equal? compare arches too - if (!compare) { + if (!compare) { int lscore, rscore; char *eolarch = strchr(larch, '@'); char *eorarch = strchr(rarch, '@'); @@ -1662,7 +1662,7 @@ Pkg_compare_pkg(lpkg, rpkg) } if (eolarch) *eolarch = '@'; if (eorarch) *eorarch = '@'; - } + } /* restore info string modified */ if (lpkg->info) { lrelease[-1] = '-'; @@ -1690,24 +1690,22 @@ Pkg_compare(pkg, evr) if (!get_e_v_r(pkg, &_epoch, &_version, &_release, &_eos)) croak("undefined package"); - char *epoch = NULL, *version, *release; + char *epoch = NULL, *version, *release; - /* extract epoch and version from evr */ + /* extract epoch and version from evr */ + version = evr; + while (*version && isdigit(*version)) version++; + if (*version == ':') { + epoch = evr; + *version++ = 0; + if (!*epoch) epoch = "0"; + version[-1] = ':'; /* restore in memory modification */ + } else { + /* there is no epoch defined, so assume epoch = 0 */ version = evr; - while (*version && isdigit(*version)) version++; - if (*version == ':') { - epoch = evr; - *version++ = 0; - if (!*epoch) epoch = "0"; - version[-1] = ':'; /* restore in memory modification */ - } else { - /* there is no epoch defined, so assume epoch = 0 */ - version = evr; - } - /* continue extracting release if any */ - if ((release = strrchr(version, '-')) != NULL) { - *release++ = 0; - } + } + if ((release = strrchr(version, '-')) != NULL) + *release++ = 0; repoch = epoch && *epoch ? atoi(epoch) : 0; RETVAL = compare_evrs(_epoch, _version, _release, repoch, version, release); -- cgit v1.2.1