source: rtems/cpukit/libmisc/bspcmdline/bspcmdline_getparamrhs.c @ 0893220

4.104.115
Last change on this file since 0893220 was 0893220, checked in by Ralf Corsepius <ralf.corsepius@…>, on 11/29/09 at 12:12:39

Whitespace removal.

  • Property mode set to 100644
File size: 766 bytes
Line 
1/*
2 *  COPYRIGHT (c) 1989-2009.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
7 *  http://www.rtems.com/license/LICENSE.
8 *
9 *  $Id$
10 */
11
12#include <rtems/bspcmdline.h>
13
14const char *rtems_bsp_cmdline_get_param_rhs(
15  const char *name,
16  char       *value,
17  size_t      length
18)
19{
20  const char *p;
21  const char *rhs;
22  char       *d;
23
24  p = rtems_bsp_cmdline_get_param( name, value, length );
25  if ( !p )
26    return NULL;
27
28  rhs = &p[strlen(name)];
29  if ( *rhs != '=' )
30    return NULL;
31
32  rhs++;
33  if ( *rhs == '\"' )
34    rhs++;
35  for ( d=value ; *rhs ; )
36    *d++ = *rhs++;
37  if ( *(d-1) == '\"' )
38    d--;
39  *d = '\0';
40
41  return value;
42}
Note: See TracBrowser for help on using the repository browser.