IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 10842


Ignore:
Timestamp:
Dec 27, 2006, 9:13:01 AM (20 years ago)
Author:
eugene
Message:

moved strip_version to libohana from opihi

Location:
trunk/Ohana/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libohana/include/ohana.h

    r10073 r10842  
    124124int     remove_argument        PROTO((int N, int *argc, char **argv));
    125125void    uppercase              PROTO((char *string));
     126char   *strip_version          PROTO((char *input));
    126127char   *strsubs                PROTO((char *string, char *match, char *with));
    127128
  • trunk/Ohana/src/libohana/src/string.c

    r10306 r10842  
    218218
    219219}
     220
     221/* expect a line of the form "$Name: not supported by cvs2svn $", strip out contents */
     222char *strip_version (char *input) {
     223
     224  char *p, *q;
     225
     226  p = strstr (input, "$Name:");
     227  if (p == NULL) return (strcreate ("NONE"));
     228
     229  q = strcreate (input + 6);
     230  p = strrchr (q, '$');
     231  if (p != NULL) *p = 0;
     232  stripwhite (q);
     233  if (*q == 0) {
     234    free (q);
     235    q = strcreate ("NONE");
     236  }
     237
     238  return (q);
     239}
  • trunk/Ohana/src/opihi/lib.shell/version.c

    r8653 r10842  
    77  return (name);
    88}
    9 
    10 /* expect a line of the form "$Name: not supported by cvs2svn $", strip out contents */
    11 char *strip_version (char *input) {
    12 
    13   char *p, *q;
    14 
    15   p = strstr (input, "$Name:");
    16   if (p == NULL) return (strcreate ("NONE"));
    17 
    18   q = strcreate (input + 6);
    19   p = strrchr (q, '$');
    20   if (p != NULL) *p = 0;
    21   stripwhite (q);
    22   if (*q == 0) {
    23     free (q);
    24     q = strcreate ("NONE");
    25   }
    26 
    27   return (q);
    28 }
Note: See TracChangeset for help on using the changeset viewer.