/[cvs]/ccvs/src/expand_path.c
ViewVC logotype

Diff of /ccvs/src/expand_path.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.36 by dprice, Wed Jul 13 17:06:35 2005 UTC revision 1.37 by dprice, Wed Aug 31 16:51:01 2005 UTC
# Line 89  variable_set (char *nameval) Line 89  variable_set (char *nameval)
89    
90    
91    
92    /* Expand variable NAME into its contents, per the rules above.
93     *
94     * CVSROOT is used to expanding $CVSROOT.
95     *
96     * RETURNS
97     *   A pointer to the requested variable contents or NULL when the requested
98     *   variable is not found.
99     *
100     * ERRORS
101     *   None, though this function may generate warning messages when NAME is not
102     *   found.
103     */
104  static const char *  static const char *
105  expand_variable (const char *name, const char *file, int line)  expand_variable (const char *name, const char *cvsroot,
106                     const char *file, int line)
107  {  {
108      if (!strcmp (name, CVSROOT_ENV))      if (!strcmp (name, CVSROOT_ENV))
109          return current_parsed_root->directory;          return cvsroot;
110      else if (!strcmp (name, "RCSBIN"))      else if (!strcmp (name, "RCSBIN"))
111      {      {
112          error (0, 0, "RCSBIN internal variable is no longer supported");          error (0, 0, "RCSBIN internal variable is no longer supported");
# Line 170  expand_variable (const char *name, const Line 183  expand_variable (const char *name, const
183   *   *
184   * When FORMATSAFE is set, percent signs (`%') in variable contents are doubled   * When FORMATSAFE is set, percent signs (`%') in variable contents are doubled
185   * to prevent later expansion by format_cmdline.   * to prevent later expansion by format_cmdline.
186     *
187     * CVSROOT is used to expanding $CVSROOT.
188   */   */
189  char *  char *
190  expand_path (const char *name, bool formatsafe, const char *file, int line)  expand_path (const char *name, const char *cvsroot, bool formatsafe,
191                 const char *file, int line)
192  {  {
193      size_t s, d, p;      size_t s, d, p;
194      const char *e;      const char *e;
# Line 248  expand_path (const char *name, bool form Line 264  expand_path (const char *name, bool form
264                  expand_string (&mybuf, &mybuf_size, d + 1);                  expand_string (&mybuf, &mybuf_size, d + 1);
265              }              }
266              mybuf[--d] = '\0';              mybuf[--d] = '\0';
267              e = expand_variable (&mybuf[p+flag], file, line);              e = expand_variable (&mybuf[p+flag], cvsroot, file, line);
268    
269              if (e)              if (e)
270              {              {

Legend:
Removed from v.1.36  
changed lines
  Added in v.1.37

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26