Changeset 379
- Timestamp:
- 10/14/09 18:02:25 (5 months ago)
- Location:
- ImageMagick/trunk
- Files:
-
- 2 modified
-
ChangeLog (modified) (1 diff)
-
magick/utility.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ImageMagick/trunk/ChangeLog
r370 r379 1 2009-10-14 6.5.7-0 Pino Toscano <pino@kde...> 2 * ImageMagick fails to build in GNU/HURD due to absence of PATH_MAX. 3 1 4 2009-10-14 6.5.7-0 Cristy <quetzlzacatenango@image...> 2 5 * Black channel is now set properly when resizing CMYKA images. -
ImageMagick/trunk/magick/utility.c
r229 r379 906 906 *path='\0'; 907 907 cwd=getcwd(path,(unsigned long) extent); 908 #if defined(MAGICKCORE_HAVE_GETPID) && defined(MAGICKCORE_HAVE_READLINK) 908 #if defined(MAGICKCORE_HAVE_GETPID) && defined(MAGICKCORE_HAVE_READLINK) && defined(PATH_MAX) 909 909 { 910 910 char 911 911 link_path[MaxTextExtent], 912 real_path[PATH_MAX+1];912 execution_path[PATH_MAX+1]; 913 913 914 914 ssize_t … … 917 917 (void) FormatMagickString(link_path,MaxTextExtent,"/proc/%ld/exe", 918 918 (long) getpid()); 919 count=readlink(link_path, real_path,PATH_MAX);919 count=readlink(link_path,execution_path,PATH_MAX); 920 920 if (count == -1) 921 921 { 922 922 (void) FormatMagickString(link_path,MaxTextExtent,"/proc/%ld/file", 923 923 (long) getpid()); 924 count=readlink(link_path, real_path,PATH_MAX);924 count=readlink(link_path,execution_path,PATH_MAX); 925 925 } 926 926 if ((count > 0) && (count <= (ssize_t) PATH_MAX)) 927 927 { 928 real_path[count]='\0';929 (void) CopyMagickString(path, real_path,extent);928 execution_path[count]='\0'; 929 (void) CopyMagickString(path,execution_path,extent); 930 930 } 931 931 } … … 935 935 char 936 936 executable_path[PATH_MAX << 1], 937 real_path[PATH_MAX+1];937 execution_path[PATH_MAX+1]; 938 938 939 939 uint32_t … … 942 942 length=sizeof(executable_path); 943 943 if ((_NSGetExecutablePath(executable_path,&length) == 0) && 944 (realpath(executable_path, real_path) != (char *) NULL))945 (void) CopyMagickString(path, real_path,extent);944 (realpath(executable_path,execution_path) != (char *) NULL)) 945 (void) CopyMagickString(path,execution_path,extent); 946 946 } 947 947 #endif … … 962 962 #if defined(__WINDOWS__) 963 963 NTGetExecutionPath(path,extent); 964 #endif 965 #if defined(__GNU__) 966 { 967 char 968 *program_name, 969 *execution_path; 970 971 long 972 count; 973 974 count=0; 975 execution_path=(char *) NULL; 976 program_name=program_invocation_name; 977 if (*program_invocation_name != '/') 978 { 979 size_t 980 extent; 981 982 extent=strlen(cwd)+strlen(program_name)+1; 983 program_name=AcquireQuantumMemory(extent,sizeof(*program_name)); 984 if (program_name == (char *) NULL) 985 program_name=program_invocation_name; 986 else 987 count=FormatMagickString(program_name,extent,"%s/%s",cwd, 988 program_invocation_name); 989 } 990 if (count != -1) 991 { 992 execution_path=realpath(program_name,NULL); 993 if (execution_path != (char *) NULL) 994 (void) CopyMagickString(path,execution_path,extent); 995 } 996 if (program_name != program_invocation_name) 997 program_name=(char *) RelinquishMagickMemory(program_name); 998 execution_path=(char *) RelinquishMagickMemory(execution_path); 999 } 964 1000 #endif 965 1001 return(IsPathAccessible(path));
