tilde.c (157184) | tilde.c (165670) |
---|---|
1/* tilde.c -- Tilde expansion code (~/foo := $HOME/foo). */ 2 3/* Copyright (C) 1988,1989 Free Software Foundation, Inc. 4 5 This file is part of GNU Readline, a library for reading lines 6 of text with interactive input and history editing. 7 8 Readline is free software; you can redistribute it and/or modify it --- 390 unchanged lines hidden (view full) --- 399 { 400 expansion = (*tilde_expansion_failure_hook) (username); 401 if (expansion) 402 { 403 dirname = glue_prefix_and_suffix (expansion, filename, user_len); 404 free (expansion); 405 } 406 } | 1/* tilde.c -- Tilde expansion code (~/foo := $HOME/foo). */ 2 3/* Copyright (C) 1988,1989 Free Software Foundation, Inc. 4 5 This file is part of GNU Readline, a library for reading lines 6 of text with interactive input and history editing. 7 8 Readline is free software; you can redistribute it and/or modify it --- 390 unchanged lines hidden (view full) --- 399 { 400 expansion = (*tilde_expansion_failure_hook) (username); 401 if (expansion) 402 { 403 dirname = glue_prefix_and_suffix (expansion, filename, user_len); 404 free (expansion); 405 } 406 } |
407 free (username); | |
408 /* If we don't have a failure hook, or if the failure hook did not 409 expand the tilde, return a copy of what we were passed. */ 410 if (dirname == 0) 411 dirname = savestring (filename); 412 } | 407 /* If we don't have a failure hook, or if the failure hook did not 408 expand the tilde, return a copy of what we were passed. */ 409 if (dirname == 0) 410 dirname = savestring (filename); 411 } |
412#if defined (HAVE_GETPWENT) |
|
413 else | 413 else |
414 { 415 free (username); 416 dirname = glue_prefix_and_suffix (user_entry->pw_dir, filename, user_len); 417 } | 414 dirname = glue_prefix_and_suffix (user_entry->pw_dir, filename, user_len); 415#endif 416 417 free (username); |
418#if defined (HAVE_GETPWENT) 419 endpwent (); 420#endif 421 return (dirname); 422} 423 424 425#if defined (TEST) --- 77 unchanged lines hidden --- | 418#if defined (HAVE_GETPWENT) 419 endpwent (); 420#endif 421 return (dirname); 422} 423 424 425#if defined (TEST) --- 77 unchanged lines hidden --- |