Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37526756
en ru br
ALT Linux repos
S:1.6.14-alt2
5.0: 1.6.11-alt5
4.1: 1.6.11-alt3.M41.1
4.0: 1.6.11-alt2
+backports:1.6.11-alt3.M40.1
3.0: 1.6.5-alt1

Other repositories
Upstream:1.6.11

Group :: Sciences/Chemistry
RPM: chemtool

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: chemtool-cht.patch
Download


diff -uNr chemtool-1.6.11/main.c chemtool-1.6.11-new/main.c
--- chemtool-1.6.11/main.c	2007-08-26 14:49:26 +0300
+++ chemtool-1.6.11-new/main.c	2008-05-16 00:42:45 +0300
@@ -2938,7 +2938,7 @@
    or save operations as defined by the current i/o mode and displays error
    message dialog if necessary */
 {
-  int error;
+  int error, length;
   char errtext[255];
   char oldname[512];
   char *tempstr;
@@ -2950,6 +2950,23 @@
   strcpy (oldname, filename);
   strcpy (filename,
 	  gtk_file_selection_get_filename (GTK_FILE_SELECTION (fs)));
+
+  while ((length = strlen(filename)) > 507 )
+  {
+    snprintf (errtext, 255, "Input filename %s contains %d\r characters and this too long.\n", filename, strlen(filename));
+    gtk_label_set_text (GTK_LABEL (message), errtext);
+    gtk_widget_show (messagew);
+    gtk_grab_add (messagew);
+    strcpy (filename, oldname);
+    snprintf (errtext,255, "Chemtool 1.6.11");
+    gtk_window_set_title (GTK_WINDOW (window), errtext);
+	
+    return;
+  }
+    
+    if (strstr(filename, ".cht") == NULL)    
+	strcat(filename, ".cht");
+	  
   if (datadir == NULL || (int)strlen (datadir) == 0)
     {
       tempstr = strrchr (filename, '/');
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin