diff options
| author | Jason Rumney | 2008-03-05 10:09:03 +0000 |
|---|---|---|
| committer | Jason Rumney | 2008-03-05 10:09:03 +0000 |
| commit | da5b5435a87be1409bf8c13ce781e3991c7080e0 (patch) | |
| tree | 6c57f27cc1d94c3b907f7ef29848d5da137cdd8f /src | |
| parent | ca8a12a7e6f5694f40272c641cb34d5051318d99 (diff) | |
| download | emacs-da5b5435a87be1409bf8c13ce781e3991c7080e0.tar.gz emacs-da5b5435a87be1409bf8c13ce781e3991c7080e0.zip | |
Revert last change.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 3 | ||||
| -rw-r--r-- | src/fileio.c | 47 |
2 files changed, 12 insertions, 38 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 6c428b0d803..0ddc633e61f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -2,9 +2,6 @@ | |||
| 2 | 2 | ||
| 3 | * dispnew.c (adjust_glyph_matrix): Initialize window_height. | 3 | * dispnew.c (adjust_glyph_matrix): Initialize window_height. |
| 4 | 4 | ||
| 5 | * fileio.c (Fexpand_file_name): Decode home directory names. | ||
| 6 | (Fsubstitute_in_file_name): Decode substituted variables. | ||
| 7 | |||
| 8 | 2008-03-03 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | 5 | 2008-03-03 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> |
| 9 | 6 | ||
| 10 | * xdisp.c (handle_single_display_spec): Undo 2007-10-16 changes. | 7 | * xdisp.c (handle_single_display_spec): Undo 2007-10-16 changes. |
diff --git a/src/fileio.c b/src/fileio.c index d869bb0b2b6..c5bff5b8153 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -1408,19 +1408,6 @@ See also the function `substitute-in-file-name'. */) | |||
| 1408 | } | 1408 | } |
| 1409 | } | 1409 | } |
| 1410 | 1410 | ||
| 1411 | /* Environment variables and pwnam entries may need decoding. */ | ||
| 1412 | if (newdir) | ||
| 1413 | { | ||
| 1414 | Lisp_Object orig, decoded; | ||
| 1415 | orig = make_unibyte_string (newdir, strlen (newdir)); | ||
| 1416 | decoded = DECODE_FILE (orig); | ||
| 1417 | if (decoded != orig) | ||
| 1418 | { | ||
| 1419 | newdir = SDATA (decoded); | ||
| 1420 | multibyte = 1; | ||
| 1421 | } | ||
| 1422 | } | ||
| 1423 | |||
| 1424 | #ifdef DOS_NT | 1411 | #ifdef DOS_NT |
| 1425 | /* On DOS and Windows, nm is absolute if a drive name was specified; | 1412 | /* On DOS and Windows, nm is absolute if a drive name was specified; |
| 1426 | use the drive's current directory as the prefix if needed. */ | 1413 | use the drive's current directory as the prefix if needed. */ |
| @@ -2162,14 +2149,11 @@ duplicates what `expand-file-name' does. */) | |||
| 2162 | unsigned char *target = NULL; | 2149 | unsigned char *target = NULL; |
| 2163 | int total = 0; | 2150 | int total = 0; |
| 2164 | int substituted = 0; | 2151 | int substituted = 0; |
| 2165 | int multibyte; | ||
| 2166 | unsigned char *xnm; | 2152 | unsigned char *xnm; |
| 2167 | Lisp_Object handler; | 2153 | Lisp_Object handler; |
| 2168 | 2154 | ||
| 2169 | CHECK_STRING (filename); | 2155 | CHECK_STRING (filename); |
| 2170 | 2156 | ||
| 2171 | multibyte = STRING_MULTIBYTE (filename); | ||
| 2172 | |||
| 2173 | /* If the file name has special constructs in it, | 2157 | /* If the file name has special constructs in it, |
| 2174 | call the corresponding file handler. */ | 2158 | call the corresponding file handler. */ |
| 2175 | handler = Ffind_file_name_handler (filename, Qsubstitute_in_file_name); | 2159 | handler = Ffind_file_name_handler (filename, Qsubstitute_in_file_name); |
| @@ -2191,7 +2175,8 @@ duplicates what `expand-file-name' does. */) | |||
| 2191 | again. Important with filenames like "/home/foo//:/hello///there" | 2175 | again. Important with filenames like "/home/foo//:/hello///there" |
| 2192 | which whould substitute to "/:/hello///there" rather than "/there". */ | 2176 | which whould substitute to "/:/hello///there" rather than "/there". */ |
| 2193 | return Fsubstitute_in_file_name | 2177 | return Fsubstitute_in_file_name |
| 2194 | (make_specified_string (p, -1, endp - p, multibyte)); | 2178 | (make_specified_string (p, -1, endp - p, |
| 2179 | STRING_MULTIBYTE (filename))); | ||
| 2195 | 2180 | ||
| 2196 | #ifdef VMS | 2181 | #ifdef VMS |
| 2197 | return filename; | 2182 | return filename; |
| @@ -2242,10 +2227,7 @@ duplicates what `expand-file-name' does. */) | |||
| 2242 | o = (unsigned char *) egetenv (target); | 2227 | o = (unsigned char *) egetenv (target); |
| 2243 | if (o) | 2228 | if (o) |
| 2244 | { | 2229 | { |
| 2245 | Lisp_Object orig, decoded; | 2230 | total += strlen (o); |
| 2246 | orig = make_unibyte_string (o, strlen (o)); | ||
| 2247 | decoded = DECODE_FILE (orig); | ||
| 2248 | total += SBYTES (decoded); | ||
| 2249 | substituted = 1; | 2231 | substituted = 1; |
| 2250 | } | 2232 | } |
| 2251 | else if (*p == '}') | 2233 | else if (*p == '}') |
| @@ -2303,26 +2285,21 @@ duplicates what `expand-file-name' does. */) | |||
| 2303 | *x++ = '$'; | 2285 | *x++ = '$'; |
| 2304 | strcpy (x, target); x+= strlen (target); | 2286 | strcpy (x, target); x+= strlen (target); |
| 2305 | } | 2287 | } |
| 2306 | else | 2288 | else if (STRING_MULTIBYTE (filename)) |
| 2307 | { | 2289 | { |
| 2308 | Lisp_Object orig, decoded; | 2290 | /* If the original string is multibyte, |
| 2309 | orig = make_unibyte_string (o, strlen (o)); | 2291 | convert what we substitute into multibyte. */ |
| 2310 | decoded = DECODE_FILE (orig); | 2292 | while (*o) |
| 2311 | strncpy (x, SDATA (decoded), SBYTES (decoded)); | 2293 | { |
| 2312 | x += SBYTES (decoded); | 2294 | int c = unibyte_char_to_multibyte (*o++); |
| 2313 | 2295 | x += CHAR_STRING (c, x); | |
| 2314 | /* If environment variable needed decoding, return value | 2296 | } |
| 2315 | needs to be multibyte. */ | ||
| 2316 | if (decoded != orig) | ||
| 2317 | multibyte = 1; | ||
| 2318 | } | 2297 | } |
| 2319 | #if 0 | ||
| 2320 | else | 2298 | else |
| 2321 | { | 2299 | { |
| 2322 | strcpy (x, o); | 2300 | strcpy (x, o); |
| 2323 | x += strlen (o); | 2301 | x += strlen (o); |
| 2324 | } | 2302 | } |
| 2325 | #endif | ||
| 2326 | } | 2303 | } |
| 2327 | 2304 | ||
| 2328 | *x = 0; | 2305 | *x = 0; |
| @@ -2334,7 +2311,7 @@ duplicates what `expand-file-name' does. */) | |||
| 2334 | need to quote some $ to $$ first. */ | 2311 | need to quote some $ to $$ first. */ |
| 2335 | xnm = p; | 2312 | xnm = p; |
| 2336 | 2313 | ||
| 2337 | return make_specified_string (xnm, -1, x - xnm, multibyte); | 2314 | return make_specified_string (xnm, -1, x - xnm, STRING_MULTIBYTE (filename)); |
| 2338 | 2315 | ||
| 2339 | badsubst: | 2316 | badsubst: |
| 2340 | error ("Bad format environment-variable substitution"); | 2317 | error ("Bad format environment-variable substitution"); |