RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Jeff Johnson
  Root:   /v/rpm/cvs                       Email:  j...@rpm5.org
  Module: rpm                              Date:   29-Aug-2014 18:55:23
  Branch: rpm-5_4                          Handle: 2014082916552300

  Modified files:           (Branch: rpm-5_4)
    rpm/lib                 poptALL.c

  Log:
    - strip versioned suffixes in narrower scope

  Summary:
    Revision    Changes     Path
    2.144.2.11  +4  -4      rpm/lib/poptALL.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/lib/poptALL.c
  ============================================================================
  $ cvs diff -u -r2.144.2.10 -r2.144.2.11 poptALL.c
  --- rpm/lib/poptALL.c 27 Aug 2014 20:56:21 -0000      2.144.2.10
  +++ rpm/lib/poptALL.c 29 Aug 2014 16:55:23 -0000      2.144.2.11
  @@ -672,7 +672,6 @@
   {
       poptContext optCon;
       char * arg0 = argv[0];
  -    char * t;
       int rc;
       int xx;
       int i;
  @@ -683,9 +682,6 @@
       /*@=noeffect@*/
   #endif
   
  -    /* XXX strip off trailing -$(VERSION) suffix */
  -    if ((t = strchr(arg0, '-')) != NULL)
  -     *t = '\0';
   /*@-globs -mods@*/
       setprogname(arg0);       /* Retrofit glibc __progname */
       /* XXX glibc churn sanity */
  @@ -741,8 +737,12 @@
       /* XXX strip off the "lt-" prefix so that rpmpopt aliases "work". */
   {   static const char lt_[] = "lt-";
       const char * s = __progname;
  +    char * t;
       if (!strncmp(s, lt_, sizeof(lt_)-1))
        s += sizeof(lt_)-1;
  +    /* XXX strip off trailing -$(VERSION) suffix */
  +    if ((t = strrchr(s, '-')) != NULL && !strcmp(t+1, VERSION))
  +     *t = '\0';
   /*@-nullpass -temptrans@*/
       optCon = poptGetContext(s, argc, (const char **)argv, optionsTable, 0);
   /*@=nullpass =temptrans@*/
  @@ .
______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
CVS Sources Repository                                rpm-cvs@rpm5.org

Reply via email to