Просмотр исходного кода

libdpkg: Remove unneeded variable assignments and a variable

Guillem Jover лет назад: 18
Родитель
Сommit
2ebc4938a2
2 измененных файлов с 10 добавлено и 6 удалено
  1. 5 0
      ChangeLog
  2. 5 6
      lib/fields.c

+ 5 - 0
ChangeLog

@@ -1,3 +1,8 @@
+2008-07-02  Guillem Jover  <guillem@debian.org>
+
+	* lib/fields.c (convert_string): Remove unneeded variable assignments.
+	Get rid this way of an int variable.
+
 2008-07-02  Guillem Jover  <guillem@debian.org>
 
 	* lib/fields.c (convert_string): Change nvip to be const and use a

+ 5 - 6
lib/fields.c

@@ -38,11 +38,9 @@ convert_string(const char *filename, int lno, const char *what, int otherwise,
                const char **endpp)
 {
   const char *ep;
-  int c;
   const struct namevalue *nvip = ivip;
 
-  ep= startp;
-  if (!*ep)
+  if (!*startp)
     parse_error(filename, lno, pigp, _("%s is missing"), what);
   while (nvip->name) {
     if (strncasecmp(nvip->name, startp, nvip->length))
@@ -55,10 +53,11 @@ convert_string(const char *filename, int lno, const char *what, int otherwise,
     parse_error(filename, lno, pigp, _("`%.*s' is not allowed for %s"),
                 strnlen(startp, 50), startp, what);
   }
+
   ep = startp + nvip->length;
-  c = *ep;
-  while (isspace(c)) c= *++ep;
-  if (c && !endpp)
+  while (isspace(*ep))
+    ep++;
+  if (*ep && !endpp)
     parse_error(filename, lno, pigp, _("junk after %s"), what);
   if (endpp) *endpp= ep;
   return nvip->value;