comparison src/dired.c @ 227:0e522484dd2a r20-5b12

Import from CVS: tag r20-5b12
author cvs
date Mon, 13 Aug 2007 10:12:37 +0200
parents 262b8bb4a523
children f220cc83d72e
comparison
equal deleted inserted replaced
226:eea38c7ad7b4 227:0e522484dd2a
300 if (NILP (obj)) 300 if (NILP (obj))
301 return Qnil; 301 return Qnil;
302 d = (DIR *)get_opaque_ptr (obj); 302 d = (DIR *)get_opaque_ptr (obj);
303 closedir (d); 303 closedir (d);
304 free_opaque_ptr (obj); 304 free_opaque_ptr (obj);
305 free_cons (XCONS (unwind_obj));
305 return Qnil; 306 return Qnil;
306 } 307 }
307 308
308 static Lisp_Object 309 static Lisp_Object
309 file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, 310 file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag,
349 /* We cannot use close_directory_unwind() because we change the 350 /* We cannot use close_directory_unwind() because we change the
350 directory. The old code used to just avoid signaling errors, and 351 directory. The old code used to just avoid signaling errors, and
351 call closedir, but it was wrong, because it made sane handling of 352 call closedir, but it was wrong, because it made sane handling of
352 QUIT impossible and, besides, various utility functions like 353 QUIT impossible and, besides, various utility functions like
353 regexp_ignore_completion_p can signal errors. */ 354 regexp_ignore_completion_p can signal errors. */
354 unwind_closure = Fcons (Qnil, Qnil); 355 unwind_closure = noseeum_cons (Qnil, Qnil);
355 record_unwind_protect (file_name_completion_unwind, unwind_closure); 356 record_unwind_protect (file_name_completion_unwind, unwind_closure);
356 357
357 for (passcount = !!all_flag; NILP (bestmatch) && passcount < 2; passcount++) 358 for (passcount = !!all_flag; NILP (bestmatch) && passcount < 2; passcount++)
358 { 359 {
359 d = opendir ((char *) XSTRING_DATA (Fdirectory_file_name (dirname))); 360 d = opendir ((char *) XSTRING_DATA (Fdirectory_file_name (dirname)));
525 526
526 if (all_flag || NILP (bestmatch)) 527 if (all_flag || NILP (bestmatch))
527 return bestmatch; 528 return bestmatch;
528 if (matchcount == 1 && bestmatchsize == file_name_length) 529 if (matchcount == 1 && bestmatchsize == file_name_length)
529 return Qt; 530 return Qt;
530 return Fsubstring (bestmatch, make_int (0), make_int (bestmatchsize)); 531 return Fsubstring (bestmatch, Qzero, make_int (bestmatchsize));
531 } 532 }
532 533
533 534
534 Lisp_Object 535 Lisp_Object
535 make_directory_hash_table (char *path) 536 make_directory_hash_table (char *path)