antiright-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Antiright-devel] antiright/src/arshell file.c


From: Jeffrey Bedard
Subject: [Antiright-devel] antiright/src/arshell file.c
Date: Tue, 17 Aug 2004 18:15:56 -0400

CVSROOT:        /cvsroot/antiright
Module name:    antiright
Branch:         
Changes by:     Jeffrey Bedard <address@hidden> 04/08/17 20:36:22

Modified files:
        src/arshell    : file.c 

Log message:
        Fixed a bug that was causing files to be overwritten by the contents of 
the previously opened file.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/src/arshell/file.c.diff?tr1=1.2&tr2=1.3&r1=text&r2=text

Patches:
Index: antiright/src/arshell/file.c
diff -u antiright/src/arshell/file.c:1.2 antiright/src/arshell/file.c:1.3
--- antiright/src/arshell/file.c:1.2    Mon Aug 16 17:27:05 2004
+++ antiright/src/arshell/file.c        Tue Aug 17 20:36:22 2004
@@ -24,6 +24,8 @@
 void
 arshell_insert_file_cb()
 {
+  ARBUG;
+  
   char *file=antiright_pipe_read("cat `arshell -ADf`");
   XmTextInsert(arshell.gui.widgets.work, 
               XmTextGetInsertionPosition(arshell.gui.widgets.work),
@@ -36,6 +38,8 @@
                     XtPointer client_data,
                     XtPointer call_data)
 {
+  ARBUG;
+  
   char *label;
   XmString motif_string;
   ARCLARG;
@@ -54,6 +58,8 @@
 void
 arshell_open_file()
 {
+  ARBUG;
+  
   char *command_string;
   char *buffer;
   asprintf(&command_string, "cat %s", arshell.edit.filename);
@@ -80,11 +86,13 @@
                          XtPointer client_data,
                          XtPointer call_data)
 {
+  ARBUG;
   XmFileSelectionBoxCallbackStruct *call_pointer=call_data;
   char *c_string;
  
   if(arshell.flags.file_open)
     {
+      ARBUG;
       arshell_save_work_area();
     }
   c_string=antiright_c_string(call_pointer->value);
@@ -93,12 +101,14 @@
   XtDestroyWidget(widget);
   if(arshell.flags.saving)
     {
+      ARBUG;
       arshell.flags.file_open=True;
       arshell_save_work_area();
       arshell.flags.saving=False;
     }
   if(arshell.flags.opening)
     {
+      ARBUG;
       arshell.flags.file_open=True;
       arshell_open_file();
       arshell.flags.opening=False;
@@ -109,6 +119,7 @@
 void
 arshell_select_filename()
 {
+  ARBUG;
   Widget file_selection_widget;
   ARCLARG;
   antiright_set(XmNtitle, (XtArgVal)"File Selector");
@@ -128,6 +139,7 @@
 void
 arshell_put_text_into_file(FILE *file)
 {
+  ARBUG;
   char *text_string;
   assert(arshell.gui.widgets.work != NULL);
   text_string=XmTextGetString(arshell.gui.widgets.work);
@@ -137,6 +149,7 @@
 void
 arshell_open_file_for_writing(FILE **file_pointer)
 {
+  ARBUG;
   (*file_pointer)=fopen(arshell.edit.filename, "w");
   if((*file_pointer)==NULL)
     {
@@ -147,32 +160,39 @@
 void
 arshell_save_work_area()
 {
+  ARBUG;
   FILE* file_pointer;
   arshell.flags.saving=True;
   if(arshell.flags.file_open==False)
     {
+      ARBUG;
       arshell_select_filename();
     }
   else
     {
+      ARBUG;
       arshell_open_file_for_writing(&file_pointer);
       arshell_put_text_into_file(file_pointer);
       fclose(file_pointer);
       arshell_get_rid_of_modified_status();
       antiright_set_title(arshell.edit.filename);
     }
+  arshell.flags.saving=False;
 }
 
 void
 arshell_save_as_cb()
 {
+  ARBUG;
+  arshell.flags.saving=True;
   arshell_select_filename();
-  arshell_save_work_area();
 }
 
 void
 arshell_open_cb()
 {
+  ARBUG;
   arshell.flags.opening=True;
+  arshell.flags.saving=False;
   arshell_select_filename();
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]