Mercurial > hg > xemacs-beta
comparison src/fileio.c @ 3648:3e7493e76dc7
[xemacs-hg @ 2006-11-01 20:25:48 by adrian]
fix for ffap crash on Windows (was: [Bug: 21.5-b27] [CRASH] (file-name-directory "1:"))
-------------------- ChangeLog entries follow: --------------------
src/ChangeLog addition:
2006-11-01 Adrian Aichner <adrian@xemacs.org>
* sysdep.c (wcslen): Check for NULL pointer.
* sysdep.c (strlwr): Ditto.
* nt.c (mswindows_getdcwd): Ditto (actual cause of reported
crash).
* intl-win32.c (wcscmp): Ditto.
* intl-win32.c (wcslen): Ditto.
* intl-win32.c (wcsncpy): Ditto.
* intl-win32.c (wcscpy): Ditto.
* intl-win32.c (wcsdup): Ditto.
* fileio.c (Ffile_name_directory): Return Qnil when
mswindows_getdcwd returns NULL working directory.
author | adrian |
---|---|
date | Wed, 01 Nov 2006 20:25:50 +0000 |
parents | 305157cf3ebb |
children | a0adf5f08c44 |
comparison
equal
deleted
inserted
replaced
3647:510e0d6cee7e | 3648:3e7493e76dc7 |
---|---|
395 res[2] = '\0'; | 395 res[2] = '\0'; |
396 } | 396 } |
397 | 397 |
398 if (wd) | 398 if (wd) |
399 { | 399 { |
400 int size; | |
400 qxestrcat (res, wd); | 401 qxestrcat (res, wd); |
401 if (!IS_DIRECTORY_SEP (res[qxestrlen (res) - 1])) | 402 size = qxestrlen (res); |
402 qxestrcat (res, (Ibyte *) "/"); | 403 if (!IS_DIRECTORY_SEP (res[size - 1])) |
404 { | |
405 res[size] = DIRECTORY_SEP; | |
406 res[size + 1] = '\0'; | |
407 } | |
403 beg = res; | 408 beg = res; |
404 p = beg + qxestrlen (beg); | 409 p = beg + qxestrlen (beg); |
410 } | |
411 else | |
412 { | |
413 return Qnil; | |
405 } | 414 } |
406 if (wd) | 415 if (wd) |
407 xfree (wd, Ibyte *); | 416 xfree (wd, Ibyte *); |
408 } | 417 } |
409 | 418 |