/[emacs]/emacs/src/fileio.c
ViewVC logotype

Diff of /emacs/src/fileio.c

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

revision 1.428 by monnier, Mon Nov 19 21:50:44 2001 UTC revision 1.429 by monnier, Mon Nov 26 22:54:37 2001 UTC
# Line 336  use the standard functions without calli Line 336  use the standard functions without calli
336       Lisp_Object filename, operation;       Lisp_Object filename, operation;
337  {  {
338    /* This function must not munge the match data.  */    /* This function must not munge the match data.  */
339    Lisp_Object chain, inhibited_handlers;    Lisp_Object chain, inhibited_handlers, result = Qnil;
340      int pos = -1;
341    
342    CHECK_STRING (filename);    CHECK_STRING (filename);
343    
# Line 353  use the standard functions without calli Line 354  use the standard functions without calli
354        if (CONSP (elt))        if (CONSP (elt))
355          {          {
356            Lisp_Object string;            Lisp_Object string;
357              int match_pos;
358            string = XCAR (elt);            string = XCAR (elt);
359            if (STRINGP (string) && fast_string_match (string, filename) >= 0)            if (STRINGP (string)
360                  && (match_pos = fast_string_match (string, filename)) > pos)
361              {              {
362                Lisp_Object handler, tem;                Lisp_Object handler, tem;
363    
364                handler = XCDR (elt);                handler = XCDR (elt);
365                tem = Fmemq (handler, inhibited_handlers);                tem = Fmemq (handler, inhibited_handlers);
366                if (NILP (tem))                if (NILP (tem))
367                  return handler;                  {
368                      result = handler;
369                      pos = match_pos;
370                    }
371              }              }
372          }          }
373    
374        QUIT;        QUIT;
375      }      }
376    return Qnil;    return result;
377  }  }
378    
379  DEFUN ("file-name-directory", Ffile_name_directory, Sfile_name_directory,  DEFUN ("file-name-directory", Ffile_name_directory, Sfile_name_directory,
# Line 2101  duplicates what `expand-file-name' does. Line 2107  duplicates what `expand-file-name' does.
2107    
2108          /* Get variable value */          /* Get variable value */
2109          o = (unsigned char *) egetenv (target);          o = (unsigned char *) egetenv (target);
2110          if (!o) goto badvar;          if (o)
2111          total += strlen (o);            {
2112          substituted = 1;              total += strlen (o);
2113                substituted = 1;
2114              }
2115            else if (*p == '}')
2116              goto badvar;
2117        }        }
2118    
2119    if (!substituted)    if (!substituted)
# Line 2153  duplicates what `expand-file-name' does. Line 2163  duplicates what `expand-file-name' does.
2163          /* Get variable value */          /* Get variable value */
2164          o = (unsigned char *) egetenv (target);          o = (unsigned char *) egetenv (target);
2165          if (!o)          if (!o)
2166            goto badvar;            {
2167                *x++ = '$';
2168          if (STRING_MULTIBYTE (filename))              strcpy (x, target); x+= strlen (target);
2169              }
2170            else if (STRING_MULTIBYTE (filename))
2171            {            {
2172              /* If the original string is multibyte,              /* If the original string is multibyte,
2173                 convert what we substitute into multibyte.  */                 convert what we substitute into multibyte.  */

Legend:
Removed from v.1.428  
changed lines
  Added in v.1.429

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