5135 |
|
|
5136 |
pwd = get_current_dir_name (); |
pwd = get_current_dir_name (); |
5137 |
|
|
5138 |
if(!pwd) |
if (!pwd) |
5139 |
fatal ("`get_current_dir_name' failed: %s\n", strerror (errno)); |
fatal ("`get_current_dir_name' failed: %s\n", strerror (errno)); |
5140 |
|
|
5141 |
#ifndef VMS |
#ifndef VMS |
5144 |
rc = strlen (pwd); |
rc = strlen (pwd); |
5145 |
if (!(IS_DIRECTORY_SEP (pwd[rc - 1]))) |
if (!(IS_DIRECTORY_SEP (pwd[rc - 1]))) |
5146 |
{ |
{ |
5147 |
|
/* Grow buffer to add directory separator and '\0'. */ |
5148 |
|
pwd = (char *) xrealloc (pwd, rc + 2); |
5149 |
pwd[rc] = DIRECTORY_SEP; |
pwd[rc] = DIRECTORY_SEP; |
5150 |
pwd[rc + 1] = '\0'; |
pwd[rc + 1] = '\0'; |
5151 |
} |
} |
5154 |
current_buffer->directory = make_unibyte_string (pwd, strlen (pwd)); |
current_buffer->directory = make_unibyte_string (pwd, strlen (pwd)); |
5155 |
if (! NILP (buffer_defaults.enable_multibyte_characters)) |
if (! NILP (buffer_defaults.enable_multibyte_characters)) |
5156 |
/* At this momemnt, we still don't know how to decode the |
/* At this momemnt, we still don't know how to decode the |
5157 |
direcotry name. So, we keep the bytes in multibyte form so |
directory name. So, we keep the bytes in multibyte form so |
5158 |
that ENCODE_FILE correctly gets the original bytes. */ |
that ENCODE_FILE correctly gets the original bytes. */ |
5159 |
current_buffer->directory |
current_buffer->directory |
5160 |
= string_to_multibyte (current_buffer->directory); |
= string_to_multibyte (current_buffer->directory); |